Um-Mitternacht / Bewitchment

Mod inspired by Witchery
118 stars 69 forks source link

Adding a null check in SyncExtendedPlayer to prevent crashing. #661

Closed TheFlash787 closed 4 years ago

TheFlash787 commented 4 years ago

Hey! We were having an issue on our server where a player had been repeatedly generating crash reports whilst exploring the world but since VanillaFix was installed it hadn't crashed the client entirely: crash-2020-10-14_02.33.18-client.txt

java.util.concurrent.ExecutionException: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
    at com.bewitchment.api.message.SyncExtendedPlayer$Handler.lambda$onMessage$0(SyncExtendedPlayer.java:38)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at net.minecraft.util.Util.runTask(Util.java:529)

I wasn't too sure whether this would occur on a fresh install only with Bewitchment installed or whether it was due to a messy interaction with another mod - since this was on MC Eternal, but I thought it'd be best to put in a null check for all of the possible variables in the crash, just to be safe.

I hope this helps, if I notice any more issues in a public server environment that I'm able to fix, I'll be sure to send in another PR. Thank you!