Null checker

This commit is contained in:
LCastr0 2017-04-26 01:39:26 -03:00
parent 6145d9f87d
commit 56f19ec937

View File

@ -153,7 +153,8 @@ public class CastleManager extends MiniPlugin
UtilPlayer.message(oldKing.getKing(), F.main("Kingdom", "You are no longer the king of that castle!")); UtilPlayer.message(oldKing.getKing(), F.main("Kingdom", "You are no longer the king of that castle!"));
} }
} }
Bukkit.broadcastMessage(F.main("Kingdom", "" + F.name(newKing.getKing().getName()) + " is the new King of this lobby!")); if (newKing != null && newKing.getKing().isOnline())
Bukkit.broadcastMessage(F.main("Kingdom", "" + F.name(newKing.getKing().getName()) + " is the new King of this lobby!"));
setKing(newKing); setKing(newKing);
} }