Fixed NPE Throwing From Console Disband

This commit is contained in:
Driftay 2020-01-01 02:34:59 -05:00
parent fb32d2155b
commit 1f9965b13a

View File

@ -339,7 +339,11 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
public void disband(Player disbander, PlayerDisbandReason reason) { public void disband(Player disbander, PlayerDisbandReason reason) {
boolean disbanderIsConsole = disbander == null; boolean disbanderIsConsole = disbander == null;
FPlayer fdisbander = FPlayers.getInstance().getByOfflinePlayer(disbander); FPlayer fdisbander = null;
if(!disbanderIsConsole){
fdisbander= FPlayers.getInstance().getByOfflinePlayer(disbander);
}
FactionDisbandEvent disbandEvent = new FactionDisbandEvent(disbander, this.getId(), reason); FactionDisbandEvent disbandEvent = new FactionDisbandEvent(disbander, this.getId(), reason);
Bukkit.getServer().getPluginManager().callEvent(disbandEvent); Bukkit.getServer().getPluginManager().callEvent(disbandEvent);