Check for non-existent class alias; Fixes BUKKIT-1780

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot 2012-06-09 15:58:53 -05:00
parent 03af91781c
commit 681de09ad0

View File

@ -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();