From 750cc107ae2b9b3c473e91ee651b10f6f46cb763 Mon Sep 17 00:00:00 2001 From: Taylor Kelly Date: Mon, 10 Jan 2011 11:00:53 +0800 Subject: [PATCH] Fixed NPE --- .../java/net/minecraft/server/NetServerHandler.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 87df11b41b..c9a3a2a129 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -282,9 +282,13 @@ public class NetServerHandler extends NetHandler // Craftbukkit start CraftBlock block = (CraftBlock) player.getWorld().getBlockAt(l, i1, j1); - int blockID = block.getTypeID(); - float damage = Block.m[blockID].a(player.getHandle()); //Get amount of damage going to block - + int blockID = 0; + float damage = 0; + if(block != null) { + blockID = block.getTypeID(); + damage = Block.m[blockID].a(player.getHandle()); //Get amount of damage going to block + } + if (packet14blockdig.e == 0) { if (i2 > 16 || flag) { if(blockID > 0) {