Fix NPE when pressing keybind with no held item
This commit is contained in:
parent
8d66575530
commit
b1d73e3383
|
@ -23,7 +23,7 @@ public class BMKeyBinding extends KeyBinding
|
||||||
public void handleKeyPress()
|
public void handleKeyPress()
|
||||||
{
|
{
|
||||||
ItemStack itemStack = ClientHandler.minecraft.thePlayer.getHeldItemMainhand();
|
ItemStack itemStack = ClientHandler.minecraft.thePlayer.getHeldItemMainhand();
|
||||||
if (itemStack.getItem() instanceof IKeybindable)
|
if (itemStack != null && itemStack.getItem() instanceof IKeybindable)
|
||||||
{
|
{
|
||||||
BloodMagicPacketHandler.INSTANCE.sendToServer(new KeyProcessor(this.keyType, false));
|
BloodMagicPacketHandler.INSTANCE.sendToServer(new KeyProcessor(this.keyType, false));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue