coinbase / coinbase-java

Coinbase API v1 library for Java
Apache License 2.0
149 stars 98 forks source link

String index out of range #20

Closed gustavorps closed 9 years ago

gustavorps commented 9 years ago
 java.lang.StringIndexOutOfBoundsException: String index out of range: -1
! at java.lang.String.substring(String.java:1871) ~[na:1.7.0_75]
! at org.whispersystems.bithub.storage.CoinbaseTransactionParser.parseUrlFromMessage(CoinbaseTransactionParser.java:55) ~[BitHub-0.1.jar:0.1]
  public String parseUrlFromMessage() throws ParseException {
    String message = StringEscapeUtils.unescapeHtml4(coinbaseTransaction.getNotes());
    int urlIndex = message.indexOf("https://");

    return message.substring(urlIndex).trim(); // this line
  }
gustavorps commented 9 years ago

Excuse my lack of attention, the problem is not that library.