summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-20 16:50:08 +0100
committersnowleo <schneeleo@gmail.com>2011-11-20 16:50:08 +0100
commit1e4a54baca307f844f02794a04564d85d7508a1a (patch)
tree109ac5114f7d857a630a673fdeb1a13ff14798fb /EssentialsProtect
parent14cc49942102856cc076d654cc2a4ad4041b789d (diff)
downloadEssentials-1e4a54baca307f844f02794a04564d85d7508a1a.tar
Essentials-1e4a54baca307f844f02794a04564d85d7508a1a.tar.gz
Essentials-1e4a54baca307f844f02794a04564d85d7508a1a.tar.lz
Essentials-1e4a54baca307f844f02794a04564d85d7508a1a.tar.xz
Essentials-1e4a54baca307f844f02794a04564d85d7508a1a.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.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;