Fixed potential NPE in TileTank

This commit is contained in:
CovertJaguar 2012-07-29 05:01:43 -07:00
parent 093d5229e2
commit 94bb9bf0e8

View file

@ -91,7 +91,8 @@ public class TileTank extends TileBuildCraft implements ITankContainer
public void writeToNBT(NBTTagCompound data)
{
super.writeToNBT(data);
data.setTag("tank", tank.getLiquid().writeToNBT(new NBTTagCompound()));
if(tank.getLiquid() != null)
data.setTag("tank", tank.getLiquid().writeToNBT(new NBTTagCompound()));
}
/* HELPER FUNCTIONS */