
Crash on ATM10 2.4.7 from trying to call a method on null
Closed this issue ยท 2 comments
Right clicked the Advanced Dominion Wand on an ME Source Jar from Ars Energistique. I believe it's because AdvancedDominionData.fromItemStack
can return null
.
You probably just need to check data
for null
here and cancel out early to avoid calling a method on something that might not exist:
Here is the crash log if it helps:
https://gist.github.com/Meantub/2e55c1b3d737456aa4030ed665f05ba5
63 does not write the data to the stack, it gets what the stack currently is set to or a default value without setting it.
64 takes care of this by writing the new value after being toggled.
64 sets the data variable to the return value of write
write returns the previous value, or null if it was previously unset
so in the state where there is no current value, using the wand without holding shift will:
get the default value
write the default value and set "data" to null
65 then tries to call data.mode(), which, when null, is trying to call the mode
method from null.