Reskillable

Reskillable

12M Downloads

PlayerDataHandler may throw NullPointerException

Charnuz opened this issue ยท 2 comments

commented


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.

crash-2019-11-03_08.56.11-client.txt

commented

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.

commented

Will do some testing to see if I can replicate the issue with vanillafix bug fixes off or disabled in general.