From 686807e387f47869c60983301050caaa069a7a82 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Thu, 20 Dec 2012 10:45:12 -0600 Subject: [PATCH] Filter invalid ItemStacks from Packets. Invalid ItemStacks are causing Fireworks to disconnect players and prevent them from reconnecting --- src/main/java/net/minecraft/server/Packet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java index a754da985f..7472d44107 100644 --- a/src/main/java/net/minecraft/server/Packet.java +++ b/src/main/java/net/minecraft/server/Packet.java @@ -210,7 +210,7 @@ public abstract class Packet { } public static void a(ItemStack itemstack, DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException - if (itemstack == null) { + if (itemstack == null || itemstack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem() dataoutputstream.writeShort(-1); } else { dataoutputstream.writeShort(itemstack.id);