Bug - Fixed pull with no input generates a stacktrace

Code:
Unexpected error, debug log printed.
class java.lang.StringIndexOutOfBoundsException: String index out of range: 0
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:694)
	at net.sourceforge.kolmafia.persistence.ItemFinder.getFirstMatchingItem(ItemFinder.java:400)
	at net.sourceforge.kolmafia.persistence.ItemFinder.getMatchingItemList(ItemFinder.java:570)
	at net.sourceforge.kolmafia.persistence.ItemFinder.getMatchingItemList(ItemFinder.java:528)
	at net.sourceforge.kolmafia.textui.command.StorageCommand.run(StorageCommand.java:101)
	at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:614)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:567)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:468)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:336)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:190)
	at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:164)

attached is a quick patch to fix. This is super-minor, but probably a good idea since other things call getFirstMatchingItem, and those will have the same issue.
 

Attachments

  • pull_stacktrace.patch
    645 bytes · Views: 48
Top