NullPointerException - please use try {} catch {}
superflexible opened this issue · 2 comments
Hello,
when opening a SecurityCraft dialog, I got the following crash. Such crashes can easily avoided if you put try {} catch {} around onPlaySoundAtEntity and all event handlers and other functions. Please do it, it would make MineCraft so much better!
java.lang.NullPointerException: Updating screen events
at me.ichun.mods.morph.common.core.EventHandlerServer.onPlaySoundAtEntity(EventHandlerServer.java:74)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_140_EventHandlerServer_onPlaySoundAtEntity_PlaySoundAtEntityEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179)
at net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(ForgeEventFactory.java:463)
at net.minecraft.client.entity.EntityPlayerSP.func_184185_a(EntityPlayerSP.java:581)
at net.geforcemods.securitycraft.gui.GuiCheckPassword.func_73869_a(GuiCheckPassword.java:105)
at net.minecraft.client.gui.GuiScreen.func_146282_l(GuiScreen.java:558)
at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:512)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1757)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1096)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:397)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)