Fix #977 add additional defensive checks to BeekeepingLogic

This commit is contained in:
mezz committed 2015-11-21 11:24:35 -08:00
1 parent db7736f7d2
commit 7d83e28a03
1 file changed
+6
@@ -289,7 +289,13 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable {
/** Checks if a queen is alive. Much faster than reading the whole bee nbt */
private static boolean isQueenAlive(ItemStack queenStack) {
if (queenStack == null) {
return false;
}
NBTTagCompound nbtTagCompound = queenStack.getTagCompound();
if (nbtTagCompound == null) {
return false;
}
int health = nbtTagCompound.getInteger("Health");
return health > 0;
}