diff options
author | snowleo <schneeleo@gmail.com> | 2011-11-20 16:50:08 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-11-20 16:50:08 +0100 |
commit | 40f3f7fcd1f3a1cdcfbe5aad75c52f6a469f9427 (patch) | |
tree | 092b01aecc7fc0a5bdb61735770f581f0440e2e0 /EssentialsProtect | |
parent | dacad38dd95e851cc6387bcb2a3b57204b4dee9b (diff) | |
download | Essentials-40f3f7fcd1f3a1cdcfbe5aad75c52f6a469f9427.tar Essentials-40f3f7fcd1f3a1cdcfbe5aad75c52f6a469f9427.tar.gz Essentials-40f3f7fcd1f3a1cdcfbe5aad75c52f6a469f9427.tar.lz Essentials-40f3f7fcd1f3a1cdcfbe5aad75c52f6a469f9427.tar.xz Essentials-40f3f7fcd1f3a1cdcfbe5aad75c52f6a469f9427.zip |
Prevent NPE with creatures that are not added to bucket yet.
Diffstat (limited to 'EssentialsProtect')
-rw-r--r-- | EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index bbf67607f..f901844d2 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -14,6 +14,7 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.entity.CreatureType; import org.bukkit.entity.Creeper; import org.bukkit.entity.Entity; import org.bukkit.entity.Fireball; @@ -309,7 +310,12 @@ public class EssentialsProtectEntityListener extends EntityListener { return; } - final String creatureName = event.getCreatureType().toString().toLowerCase(); + final CreatureType creature = event.getCreatureType(); + if (creature == null) + { + return; + } + final String creatureName = creature.toString().toLowerCase(); if (creatureName == null || creatureName.isEmpty()) { return; |