Skip to content

Commit

Permalink
Additional checks for InventoryLogic to prevent crashes with invalid …
Browse files Browse the repository at this point in the history
…slots.
  • Loading branch information
bonii-xx committed Oct 17, 2014
1 parent 8a75398 commit cb2a0cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mantle/blocks/abstracts/InventoryLogic.java
Expand Up @@ -40,12 +40,12 @@ public InventoryLogic(int invSize, int maxStackSize)
@Override
public ItemStack getStackInSlot (int slot)
{
return inventory[slot];
return slot < inventory.length ? inventory[slot] : null;
}

public boolean isStackInSlot (int slot)
{
return inventory[slot] != null;
return slot < inventory.length && inventory[slot] != null;
}

@Override
Expand Down

0 comments on commit cb2a0cf

Please sign in to comment.