Bug - Fixed Trying to equip a sticker from the CLI fails and prints an error

This may be related to 2crs, but it could also be something introduced recently. I've just started 2crs three days ago, and today was the first time trying to equip stickers.

Pretty simply, I can no longer add stickers to my scratch n sniff weapon from the cli anymore.

Reproduce:
Code:
equip scratch 'n' sniff unicorn sticker
used in the CLI gives:

Code:
Putting on scratch 'n' sniff unicorn sticker...
Unexpected error, debug log printed.
Equipment changed.

And seems to fail to equip it.

The same happens when trying to do it from the gear changer "customizable" page



Debug log printed:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
             KoLmafia r27199, Windows 10, Java 17.0.3
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread of KoL's
 Gameplay-Discussion forum. If you would like the KoLmafia dev team
 to look at it, please write a bug report at kolmafia.us. Include
 specific information about what you were doing when you made this
 and include this log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Wed Feb 15 07:05:15 MST 2023
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 User: Shiverwarp
 Current run: 1005
 MRU Script: Unknown
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.util.EnumMap.get(Object)" is null
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.util.EnumMap.get(Object)" is null
    at net.sourceforge.kolmafia.session.EquipmentManager.setTurns(EquipmentManager.java:1429)
    at net.sourceforge.kolmafia.request.EquipmentRequest.parseBedazzlements(EquipmentRequest.java:1050)
    at net.sourceforge.kolmafia.request.EquipmentRequest.processResults(EquipmentRequest.java:888)
    at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:2207)
    at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:2113)
    at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:1728)
    at net.sourceforge.kolmafia.request.GenericRequest.externalExecute(GenericRequest.java:1395)
    at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1382)
    at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1149)
    at net.sourceforge.kolmafia.request.EquipmentRequest.run(EquipmentRequest.java:859)
    at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:242)
    at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:207)
    at net.sourceforge.kolmafia.textui.command.EquipCommand.equip(EquipCommand.java:106)
    at net.sourceforge.kolmafia.textui.command.EquipCommand.run(EquipCommand.java:24)
    at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:467)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:433)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:352)
    at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:239)
    at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.handleQueue(CommandDisplayFrame.java:139)
    at net.sourceforge.kolmafia.swingui.CommandDisplayFrame$CommandQueueHandler.run(CommandDisplayFrame.java:116)
 

Ryo_Sangnoir

Developer
Staff member
Almost surely came in the r27185 refactor. I converted an int[] to a Map. I converted most of the gets to getOrDefaults, but not all of them.
 
Top