diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-09 17:13:47 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-09 17:14:00 +0000 |
commit | a7beacd2ff65edac23b635b4d33c303f7b883489 (patch) | |
tree | 758c5b110bb1de67ea91e70507b64bd8cb18b356 /src/main/java/org | |
parent | 3ae2ce4c30a911f0617862e600351b10a0052fa7 (diff) | |
download | bukkit-a7beacd2ff65edac23b635b4d33c303f7b883489.tar bukkit-a7beacd2ff65edac23b635b4d33c303f7b883489.tar.gz bukkit-a7beacd2ff65edac23b635b4d33c303f7b883489.tar.lz bukkit-a7beacd2ff65edac23b635b4d33c303f7b883489.tar.xz bukkit-a7beacd2ff65edac23b635b4d33c303f7b883489.zip |
Fixed silly NPE during shutdown when java becomes a meanie-pants and steals our lunch money :(
Diffstat (limited to 'src/main/java/org')
-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) } } |