From 681de09ad073eff251ce2239eec7b986ea1bd017 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 9 Jun 2012 15:58:53 -0500 Subject: [PATCH] Check for non-existent class alias; Fixes BUKKIT-1780 By: Wesley Wolfe --- .../serialization/ConfigurationSerialization.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java b/paper-api/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java index f690459f38..abfc4b600e 100644 --- a/paper-api/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java +++ b/paper-api/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();