Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

[bug] NullPointerException if Core.lastServerPlayerEntity is null #34

Closed
LemmaEOF opened this issue Jan 19, 2020 · 1 comment
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists important

Comments

@LemmaEOF
Copy link

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

@LemmaEOF LemmaEOF added the bug Something isn't working label Jan 19, 2020
@Siphalor
Copy link
Owner

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

@Siphalor Siphalor added the duplicate This issue or pull request already exists label Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working duplicate This issue or pull request already exists important
Projects
None yet
Development

No branches or pull requests

2 participants