Fixed potential NullPointerException on server loading

This commit is contained in:
simon 2018-01-09 20:09:46 -05:00
parent e1dfb08635
commit 2fbc55d0dd

View File

@ -48,7 +48,9 @@ public class HarvesterNPC extends NonPlayerCharacter {
@Override
public void onDeadCallback() {
getFactory().getNpcs().remove(this);
if (getFactory() != null && getFactory().getNpcs() != null) {
getFactory().getNpcs().remove(this);
}
GameServer.INSTANCE.getEventDispatcher().dispatch(
new ObjectDeathEvent(this, ID));