Skip to content

Commit

Permalink
If Player is null, key context is invalid. ( #269 )
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed May 23, 2017
1 parent 0aa7004 commit b4a5374
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/mod/chiselsandbits/client/ModConflictContext.java
Expand Up @@ -8,6 +8,7 @@
import mod.chiselsandbits.core.ClientSide;
import mod.chiselsandbits.helpers.ChiselToolType;
import mod.chiselsandbits.interfaces.IVoxelBlobItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
Expand Down Expand Up @@ -125,7 +126,14 @@ public void setItemActive(
@Override
public boolean isActive()
{
final ItemStack held = ClientSide.instance.getPlayer().getHeldItemMainhand();
EntityPlayer player = ClientSide.instance.getPlayer();

if ( player == null )
{
return false;
}

final ItemStack held = player.getHeldItemMainhand();

if ( held == null )
{
Expand Down

0 comments on commit b4a5374

Please sign in to comment.