diff options
-rw-r--r-- | src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index 8a63e101..0bd5ec9a 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -241,10 +241,15 @@ public class JavaPluginLoader implements PluginLoader { public void removeClass(String name) { Class<?> clazz = classes.remove(name); - - if ((clazz != null) && (ConfigurationSerializable.class.isAssignableFrom(clazz))) { - Class<? extends ConfigurationSerializable> serializable = (Class<? extends ConfigurationSerializable>)clazz; - ConfigurationSerialization.unregisterClass(serializable); + + try { + if ((clazz != null) && (ConfigurationSerializable.class.isAssignableFrom(clazz))) { + Class<? extends ConfigurationSerializable> serializable = (Class<? extends ConfigurationSerializable>)clazz; + ConfigurationSerialization.unregisterClass(serializable); + } + } catch (NullPointerException ex) { + // Boggle! + // (Native methods throwing NPEs is not fun when you can't stop it before-hand) } } |