From 5f7155c54599cd4ec51ea6561e8bfa105c20a848 Mon Sep 17 00:00:00 2001 From: fabricator77 Date: Tue, 20 May 2014 20:58:38 +0930 Subject: [PATCH] Fix backpack crash Check to make sure itemstack isn't null Closes #15 --- .../storage/forestry/storage/BackpackDefinition.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/forestry_common/storage/forestry/storage/BackpackDefinition.java b/forestry_common/storage/forestry/storage/BackpackDefinition.java index c761e7f4d..d8f37c586 100755 --- a/forestry_common/storage/forestry/storage/BackpackDefinition.java +++ b/forestry_common/storage/forestry/storage/BackpackDefinition.java @@ -72,11 +72,13 @@ public class BackpackDefinition implements IBackpackDefinition { @Override public boolean isValidItem(EntityPlayer player, ItemStack itemstack) { for (ItemStack stack : getValidItems(player)) - if (stack.getItemDamage() == Defaults.WILDCARD) { - if (stack.getItem() == itemstack.getItem()) + if (stack != null) { + if (stack.getItemDamage() == Defaults.WILDCARD) { + if (stack.getItem() == itemstack.getItem()) + return true; + } else if (stack.isItemEqual(itemstack)) return true; - } else if (stack.isItemEqual(itemstack)) - return true; + } return false; }