From a18f26f8afc9693ff5ace7ad80dd1bdc715cc456 Mon Sep 17 00:00:00 2001 From: wizjany Date: Sat, 6 Jul 2019 09:44:53 -0400 Subject: [PATCH] Play nicer with naughty plugins. --- .../main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java index f311a9e1b..79526882f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitAdapter.java @@ -335,7 +335,11 @@ public class BukkitAdapter { * @return WorldEdit EntityType */ public static EntityType adapt(org.bukkit.entity.EntityType entityType) { - return EntityTypes.get(entityType.getName().toLowerCase(Locale.ROOT)); + final String name = entityType.getName(); + if (name == null) { + return null; + } + return EntityTypes.get(name.toLowerCase(Locale.ROOT)); } public static org.bukkit.entity.EntityType adapt(EntityType entityType) {