Make sure the party leader is online before attempting to notify

This commit is contained in:
TfT_02 2014-01-18 19:06:20 +01:00
parent b460f7a564
commit 3b794c897d

View File

@ -207,11 +207,13 @@ public class Party {
if (!Config.getInstance().getPartyInformAllMembers()) { if (!Config.getInstance().getPartyInformAllMembers()) {
Player leader = mcMMO.p.getServer().getPlayer(this.leader); Player leader = mcMMO.p.getServer().getPlayer(this.leader);
if (leader != null) {
leader.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, getLevel())); leader.sendMessage(LocaleLoader.getString("Party.LevelUp", levelsGained, getLevel()));
if (Config.getInstance().getLevelUpSoundsEnabled()) { if (Config.getInstance().getLevelUpSoundsEnabled()) {
leader.playSound(leader.getLocation(), Sound.LEVEL_UP, Misc.LEVELUP_VOLUME, Misc.LEVELUP_PITCH); leader.playSound(leader.getLocation(), Sound.LEVEL_UP, Misc.LEVELUP_VOLUME, Misc.LEVELUP_PITCH);
} }
}
return; return;
} }