summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-26 18:48:32 +1000
committermd_5 <git@md-5.net>2018-08-26 18:48:32 +1000
commit2a271162afa43f26490487040a47daa5188e1e61 (patch)
tree6a552eb9c9e498a8e1e452900c5b2a29a71f327b /src
parent5d0d83bb90b240a065599e5144a91181c6212ca6 (diff)
downloadcraftbukkit-2a271162afa43f26490487040a47daa5188e1e61.tar
craftbukkit-2a271162afa43f26490487040a47daa5188e1e61.tar.gz
craftbukkit-2a271162afa43f26490487040a47daa5188e1e61.tar.lz
craftbukkit-2a271162afa43f26490487040a47daa5188e1e61.tar.xz
craftbukkit-2a271162afa43f26490487040a47daa5188e1e61.zip
SPIGOT-4301: Fix more invalid enchants
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
index 03d2392a..f1f41262 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
@@ -9,6 +9,9 @@ public final class CraftNamespacedKey {
}
public static NamespacedKey fromStringOrNull(String string) {
+ if (string == null || string.isEmpty()) {
+ return null;
+ }
MinecraftKey minecraft = MinecraftKey.a(string);
return (minecraft == null) ? null : fromMinecraft(minecraft);
}