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

(cherry picked from commit 882e0e3bf22784d693e3816b0efeba5fbedb1a22)
This commit is contained in:
LexManos 2016-12-05 12:13:39 -08:00
parent 4b7219c07f
commit 621d67d36a

View file

@ -46,18 +46,23 @@
} }
} }
} }
@@ -1205,6 +1207,10 @@ @@ -1205,6 +1207,15 @@
{ {
tileentity.func_145839_a(p_147273_1_.func_148857_g()); tileentity.func_145839_a(p_147273_1_.func_148857_g());
} }
+ else + 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_); + tileentity.onDataPacket(field_147302_e, p_147273_1_);
+ } + }
if (flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock) if (flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock)
{ {
@@ -1302,15 +1308,15 @@ @@ -1302,15 +1313,15 @@
} }
else if (f == 101.0F) else if (f == 101.0F)
{ {
@ -76,7 +81,7 @@
} }
} }
else if (i == 6) else if (i == 6)
@@ -1424,7 +1430,7 @@ @@ -1424,7 +1435,7 @@
if (entity instanceof EntityLivingBase) if (entity instanceof EntityLivingBase)
{ {