Bug - Fixed Unexpected Error when deleting last highlighted item

NataliaM

New member
Very minor error. I was just playing around with chat "Add Highlighting". when I go to remove highlighting, it works fine until i get to the very last one listed, then it does a "Unexpected Error, debug log printed". This has been happening for the last several builds, most recent I was able to duplicate it in was 10112.

The last highlighted entry never seems to be removed. it will show up in chat for a few times, then just disappear. Like I said, this isn't anything major at all, just passing it along.

Below is what the log is saying:
Unexpected error, debug log printed.
class java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.kolmafia.swingui.listener.InvocationListener.execute(InvocationListener.java:69)
at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:214)
at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:263)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at net.sourceforge.kolmafia.chat.ChatFormatter.removeHighlighting(ChatFormatter.java:355)
... 7 more

class java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at net.sourceforge.kolmafia.chat.ChatFormatter.removeHighlighting(ChatFormatter.java:355)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.kolmafia.swingui.listener.InvocationListener.execute(InvocationListener.java:69)
at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:214)
at net.sourceforge.kolmafia.RequestThread$ThreadWrappedRunnable.run(RequestThread.java:263)
 
Top