From 621d67d36a9180485ac850518bc37ff237e2e164 Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 5 Dec 2016 12:13:39 -0800 Subject: [PATCH] Add null check and informative error message when client receives an invalid update packet (#3266) (cherry picked from commit 882e0e3bf22784d693e3816b0efeba5fbedb1a22) --- .../client/network/NetHandlerPlayClient.java.patch | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index 11828abd0c..e58dd050e3 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -46,18 +46,23 @@ } } } -@@ -1205,6 +1207,10 @@ +@@ -1205,6 +1207,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) { -@@ -1302,15 +1308,15 @@ +@@ -1302,15 +1313,15 @@ } else if (f == 101.0F) { @@ -76,7 +81,7 @@ } } else if (i == 6) -@@ -1424,7 +1430,7 @@ +@@ -1424,7 +1435,7 @@ if (entity instanceof EntityLivingBase) {