mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +01:00
Fixed silly NPE during shutdown when java becomes a meanie-pants and steals our lunch money :(
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
a41e663ef3
commit
f63d8e600d
1 changed files with 9 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue