Add missing null check for Knapsack loading #1542

This commit is contained in:
Bernhard Bonigl committed 2015-04-19 11:39:30 +02:00
1 parent 2501749509
commit 5cf22cbc10
1 file changed
+1 -1
@@ -145,7 +145,7 @@ public class KnapsackInventory implements IInventory
public void readFromNBT (NBTTagCompound tagCompound)
{
// player doesn't have a knapsack saved, tcon probably wasn't present before. don't error out.
if(!tagCompound.hasKey("Knapsack"))
if(tagCompound == null || !tagCompound.hasKey("Knapsack"))
return;
NBTTagList tagList = tagCompound.getTagList("Knapsack", 10);