Possible NPE if the liquid isn't in the LD

https://github.com/BuildCraft/BuildCraft/issues/787
This commit is contained in:
CovertJaguar 2013-05-11 04:27:52 -06:00
parent 4cd70f5e98
commit a88692a0f2

View file

@ -54,7 +54,11 @@ public class LiquidStack
nbt.setInteger("Amount", amount);
nbt.setShort("Id", (short)itemID);
nbt.setShort("Meta", (short)itemMeta);
nbt.setString("LiquidName", LiquidDictionary.findLiquidName(this));
String name = LiquidDictionary.findLiquidName(this);
if(name != null)
{
nbt.setString("LiquidName", name);
}
if (extra != null)
{
nbt.setTag("extra", extra);