diff options
author | feildmaster <admin@feildmaster.com> | 2012-06-04 00:23:10 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-06-04 04:22:22 -0500 |
commit | d8199aaa394b4f041dbfce08813f4f6ff271eb45 (patch) | |
tree | 691063d668157e16679d6beba584222379eb6d75 /src/main/java/net/minecraft | |
parent | f15785669aefc6c19b7d67f207faa7062f2919e6 (diff) | |
download | craftbukkit-d8199aaa394b4f041dbfce08813f4f6ff271eb45.tar craftbukkit-d8199aaa394b4f041dbfce08813f4f6ff271eb45.tar.gz craftbukkit-d8199aaa394b4f041dbfce08813f4f6ff271eb45.tar.lz craftbukkit-d8199aaa394b4f041dbfce08813f4f6ff271eb45.tar.xz craftbukkit-d8199aaa394b4f041dbfce08813f4f6ff271eb45.zip |
Fix a NullPointerException.
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/Container.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java index 5b7058bf..734378bc 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -119,12 +119,14 @@ public abstract class Container { } if (j == 1) { - // CraftBukkit start - if (playerinventory.getCarried().count > 0) { - entityhuman.drop(playerinventory.getCarried().a(1)); + // CraftBukkit start - Store a reference + ItemStack itemstack1 = playerinventory.getCarried(); + if (itemstack1.count > 0) { + entityhuman.drop(itemstack1.a(1)); } - // CraftBukkit end - if (playerinventory.getCarried().count == 0) { + + if (itemstack1.count == 0) { + // CraftBukkit end playerinventory.setCarried((ItemStack) null); } } |