Nbt Crafting (Fabric)

Nbt Crafting (Fabric)

630k Downloads

[bug] NullPointerException if `Core.lastServerPlayerEntity` is null

LemmaEOF opened this issue ยท 1 comments

commented

Version
Minecraft 1.15
Describe the bug
If Core.hasClientMod is called before Core.lastServerPlayerEntity is set, then an NPE will be thrown. Core.hasClientMod can be called before the server's presence packet is received and processed, causing this crash.

To Reproduce

  1. Call Core.hasClientMod (called in NBT Crafting's hooks for caching matching stacks)
  2. NPE is thrown

Expected behavior
A null-check should be done which returns false by default if NBT crafting isn't present

Log
https://gist.github.com/Boundarybreaker/d8eb042e76076464773d0ba3dd20053d

Additional context
Occurred when trying out a new compat method for LibCD and NBT Crafting

commented

Good and helpful description. Will be fixed fast.
Still a duplicate to #33 (That title is really misleading - not your fault :) )