diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-06-09 15:58:53 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-06-09 15:58:53 -0500 |
commit | cb632c0cc332a122945da9989ad40b133a7e80df (patch) | |
tree | e5ed8fc0f6f0a345afe75e6b19eb648bfb6d74d9 /src/main/java | |
parent | 062a3df78d228bfad2cb3bb84e1b900893a0197e (diff) | |
download | bukkit-cb632c0cc332a122945da9989ad40b133a7e80df.tar bukkit-cb632c0cc332a122945da9989ad40b133a7e80df.tar.gz bukkit-cb632c0cc332a122945da9989ad40b133a7e80df.tar.lz bukkit-cb632c0cc332a122945da9989ad40b133a7e80df.tar.xz bukkit-cb632c0cc332a122945da9989ad40b133a7e80df.zip |
Check for non-existent class alias; Fixes BUKKIT-1780
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java index f690459f..abfc4b60 100644 --- a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java +++ b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java @@ -164,9 +164,11 @@ public class ConfigurationSerialization { String alias = (String) args.get(SERIALIZED_TYPE_KEY); if (alias == null) { - throw new IllegalArgumentException("Specified class does not exist ('" + alias + ")'"); - } else { - clazz = getClassByAlias(alias); + throw new IllegalArgumentException("Cannot have null alias"); + } + clazz = getClassByAlias(alias); + if (clazz == null) { + throw new IllegalArgumentException("Specified class does not exist ('" + alias + "')"); } } catch (ClassCastException ex) { ex.fillInStackTrace(); |