PlayerDataHandler may throw NullPointerException
Charnuz opened this issue ยท 2 comments
Related to #175, either
data
and/or playerWR
may be null.
Changing it to be:
if (data !=null && data.playerWR != null && data.playerWR.get() != player) {
would fix this. If PlayerData.get()
cannot ever return null then the first null check is not needed.
The first check would not be needed because if it is not already contained it gets added a few lines up. I am not to sure about how WeakReferences work but I believe the data.playerWR
should never be null either (though data.playerWR.get()
might be able to be null). Though my best guess is that some other mod (some mods that are known to screw with vanilla logic: optifine, vanilllafix), is force clearing the weak references instead of letting java handle them as they expect to. I believe with vanilla fix this can be disabled by changing the "Optimizations and vanilla bug fixes" to false in their config. Given I see that you do have VanillaFix I would recommend trying that (or trying without vanillafix installed at all) and seeing if it fixes the issue. If it does I would recommend reporting the bug to them.