PreviewPlayer
can have null playerInfo but return true in hasPlayerInfo()
#277
Labels
bug
Something isn't working
Versions (Be specific, do not write "latest"):
Observed Behavior:
Calling
hasPlayerInfo()
on an instance ofAbstractClientPlayer
(specifically inRenderPlayerEvent.Pre
in this case) and receiving a return value oftrue
still leads to a NPE on accessing theplayerInfo
field.Expected Behavior:
When calling
hasPlayerInfo()
on an instance ofAbstractClientPlayer
, a return value oftrue
should mean that accessing theplayerInfo
field of that Object should not be null.Steps to Reproduce:
This requires some other mod since this breaks an invariant of the
AbstractClientPlayer
class that is expected to be true. This can be observed with any currently released version of GregTech CE Unofficial (v2.1.4 or earlier, as we have worked around it in subsequent releases).In
c4.conarm.client.gui.PreviewPlayer
, an override ofhasPlayerInfo()
should be sufficient to address this issue. Unfortunately sincegetPlayerInfo()
is protected, there is no way for us to call that instead of directly accessing the field. As a workaround, we have resulted in null-checking theplayerInfo
field, but this issue could cause issues with other mods who have not done this fix.Crash Log:
https://pastebin.com/dAbNcjcd
Issue from our end:
GregTechCEu/GregTech#615
The text was updated successfully, but these errors were encountered: