Add null check and informative error message when client receives an invalid update packet (#3266)

This commit is contained in:
BlayTheNinth authored and LexManos committed 2016-12-03 10:25:01 -08:00
1 parent 2cb99f0e74
commit 882e0e3bf2
1 file changed
+8 -3
@@ -58,18 +58,23 @@
}
}
}
@@ -1169,6 +1176,10 @@
@@ -1169,6 +1176,15 @@
{
tileentity.func_145839_a(p_147273_1_.func_148857_g());
}
+ else
+ {
+ if(tileentity == null)
+ {
+ field_147301_d.error("Received invalid update packet for null tile entity at {} with data: {}", p_147273_1_.func_179823_a(), p_147273_1_.func_148857_g());
+ return;
+ }
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
+ }
if (flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock)
{
@@ -1266,15 +1277,15 @@
@@ -1266,15 +1282,15 @@
}
else if (f == 101.0F)
{
@@ -88,7 +93,7 @@
}
}
else if (i == 6)
@@ -1368,7 +1379,7 @@
@@ -1368,7 +1384,7 @@
if (entity instanceof EntityLivingBase)
{