Bug - Fixed Maximizer throws NPE when bejeweled pledge pin is in acc1 slot

Found on KoLmafia r20755, but I tested this all the way back to r20749 and the problem still persists.

Edit: I am in an Avatar of Sneaky Pete hardcore run. I could not reproduce this in an aftercore account.

The following directive causes the maximizer to throw a NullPointerException:
Code:
5item,meat,0.5initiative,0.1da 1000max,dr,0.5all res,1.5mainstat,mox,-fumble,0.4hp,0.2mp 1000max,3mp regen,1.5weapon damage,0.75weapon damage percent,1.5elemental damage,10exp,5Moxie experience percent,-hat,-pants,-acc1,-200combat 25max,effective
My character has the Frat Warrior Fatigues outfit equipped, with the bejeweled pledge pin in the acc1 slot. Any of the following seemingly causes the maximizer to work again:
  • Unequipping any of the war outfit components
  • Moving the pin to acc2/acc3 slot
  • Removing acc1 from the maximizer directive
Here is the debug log:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v20.7 r20755, Windows 10, Java 11.0.10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 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: Tue Jun 08 17:32:44 KST 2021
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 User: philmasterplus
 Current run: 551
 MRU Script: Unknown
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


class java.lang.NullPointerException: null
java.lang.NullPointerException
	at net.sourceforge.kolmafia.maximizer.Maximizer.emitSlot(Maximizer.java:2361)
	at net.sourceforge.kolmafia.maximizer.Maximizer.maximize(Maximizer.java:221)
	at net.sourceforge.kolmafia.maximizer.Maximizer.maximize(Maximizer.java:2213)
	at net.sourceforge.kolmafia.maximizer.Maximizer.maximize(Maximizer.java:134)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.maximize(RuntimeLibrary.java:7696)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.maximize(RuntimeLibrary.java:7686)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:110)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.Assignment.execute(Assignment.java:104)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.Assignment.execute(Assignment.java:104)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Else.execute(Else.java:66)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:74)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:97)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:64)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.Operator.applyTo(Operator.java:631)
	at net.sourceforge.kolmafia.textui.parsetree.Operation.execute(Operation.java:113)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionReturn.execute(FunctionReturn.java:101)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionReturn.execute(FunctionReturn.java:101)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:97)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:64)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:97)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:64)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.Assignment.execute(Assignment.java:104)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Try.execute(Try.java:76)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.AshRuntime.executeScope(AshRuntime.java:318)
	at net.sourceforge.kolmafia.textui.AshRuntime.execute(AshRuntime.java:234)
	at net.sourceforge.kolmafia.textui.AshRuntime.execute(AshRuntime.java:226)
	at net.sourceforge.kolmafia.textui.command.CallScriptCommand.call(CallScriptCommand.java:264)
	at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:603)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:546)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:448)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:316)
	at net.sourceforge.kolmafia.KoLmafia.executeScript(KoLmafia.java:1659)
	at net.sourceforge.kolmafia.moods.RecoveryManager.runBetweenBattleChecks(RecoveryManager.java:142)
	at net.sourceforge.kolmafia.moods.RecoveryManager.runBetweenBattleChecks(RecoveryManager.java:121)
	at net.sourceforge.kolmafia.KoLAdventure.run(KoLAdventure.java:1416)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:295)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:269)
	at net.sourceforge.kolmafia.KoLmafia.executeAdventureOnce(KoLmafia.java:1611)
	at net.sourceforge.kolmafia.KoLmafia.executeRequestOnce(KoLmafia.java:1516)
	at net.sourceforge.kolmafia.KoLmafia.executeRequest(KoLmafia.java:1454)
	at net.sourceforge.kolmafia.KoLmafia.makeRequest(KoLmafia.java:1384)
	at net.sourceforge.kolmafia.textui.RuntimeLibrary.adv1(RuntimeLibrary.java:3753)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:110)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.Assignment.execute(Assignment.java:104)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionReturn.execute(FunctionReturn.java:101)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:97)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:64)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionInvocation.execute(FunctionInvocation.java:121)
	at net.sourceforge.kolmafia.textui.parsetree.Assignment.execute(Assignment.java:104)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:97)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:64)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Loop.execute(Loop.java:60)
	at net.sourceforge.kolmafia.textui.parsetree.ForEachLoop.executeSlice(ForEachLoop.java:183)
	at net.sourceforge.kolmafia.textui.parsetree.ForEachLoop.executeSlice(ForEachLoop.java:178)
	at net.sourceforge.kolmafia.textui.parsetree.ForEachLoop.execute(ForEachLoop.java:108)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:81)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:64)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.WhileLoop.execute(WhileLoop.java:82)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Conditional.execute(Conditional.java:97)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:64)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Try.execute(Try.java:76)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Else.execute(Else.java:66)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:74)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Try.execute(Try.java:76)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Else.execute(Else.java:66)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:74)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Try.execute(Try.java:76)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Else.execute(Else.java:66)
	at net.sourceforge.kolmafia.textui.parsetree.If.execute(If.java:74)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:161)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.Try.execute(Try.java:103)
	at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:566)
	at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:136)
	at net.sourceforge.kolmafia.textui.AshRuntime.executeScope(AshRuntime.java:318)
	at net.sourceforge.kolmafia.textui.AshRuntime.execute(AshRuntime.java:234)
	at net.sourceforge.kolmafia.textui.AshRuntime.execute(AshRuntime.java:226)
	at net.sourceforge.kolmafia.textui.command.CallScriptCommand.call(CallScriptCommand.java:264)
	at net.sourceforge.kolmafia.KoLmafiaCLI.doExecuteCommand(KoLmafiaCLI.java:603)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeCommand(KoLmafiaCLI.java:546)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:448)
	at net.sourceforge.kolmafia.KoLmafiaCLI.executeLine(KoLmafiaCLI.java:316)
	at net.sourceforge.kolmafia.KoLmafiaCLI$CommandProcessorThread.run(KoLmafiaCLI.java:238)
(auto_util.ash, line 5091)
 
Last edited:
I minimized the directive to a combination that produces a NullPointerException in r20755:

Code:
0.5initiative,1.5elemental damage,-acc1

Maximizing this while having the Frat Warrior Fatigues equipped and nothing else causes the maximizer to throw a NPE:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         KoLmafia v20.7 r20755, Windows 10, Java 11.0.10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 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: Tue Jun 08 18:04:57 KST 2021
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 User: philmasterplus
 Current run: 551
 MRU Script: Unknown
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at net.sourceforge.kolmafia.maximizer.Maximizer.emitSlot(Maximizer.java:2361)
	at net.sourceforge.kolmafia.maximizer.Maximizer.maximize(Maximizer.java:221)
	at net.sourceforge.kolmafia.swingui.MaximizerFrame.maximize(MaximizerFrame.java:213)
	at net.sourceforge.kolmafia.swingui.MaximizerFrame$MaximizerPanel.actionConfirmed(MaximizerFrame.java:387)
	at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ActionConfirmListener.execute(GenericPanel.java:614)
	at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
	at net.sourceforge.kolmafia.RequestThread$SequencedRunnable.run(RequestThread.java:428)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I couldn't reproduce but assuming null is a reasonable value there (which I think it is), I've fixed the NPE in r20757
 
Top