summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java8
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;