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

This commit is contained in:
Wesley Wolfe 2012-06-09 15:58:53 -05:00
parent 062a3df78d
commit cb632c0cc3

View File

@ -164,9 +164,11 @@ public class ConfigurationSerialization {
String alias = (String) args.get(SERIALIZED_TYPE_KEY); String alias = (String) args.get(SERIALIZED_TYPE_KEY);
if (alias == null) { if (alias == null) {
throw new IllegalArgumentException("Specified class does not exist ('" + alias + ")'"); throw new IllegalArgumentException("Cannot have null alias");
} else { }
clazz = getClassByAlias(alias); clazz = getClassByAlias(alias);
if (clazz == null) {
throw new IllegalArgumentException("Specified class does not exist ('" + alias + "')");
} }
} catch (ClassCastException ex) { } catch (ClassCastException ex) {
ex.fillInStackTrace(); ex.fillInStackTrace();