Null pointer fix.

This commit is contained in:
cnaude 2015-08-27 13:46:15 -07:00
parent 710e1c3ff9
commit 88c36e11ab
2 changed files with 11 additions and 5 deletions

View File

@ -63,9 +63,11 @@ public class GamePlayerChatListener implements Listener {
plugin.logDebug("Ignore chat message due to event cancellation: " + event.getMessage());
return;
}
if (event.isCancelled() && plugin.adminPrivateChatHook.ac.toggledPlayers.contains(event.getPlayer().getName())) {
plugin.logDebug("Ignore AdminChat message due to event cancellation: " + event.getMessage());
return;
if (plugin.adminPrivateChatHook != null) {
if (event.isCancelled() && plugin.adminPrivateChatHook.ac.toggledPlayers.contains(event.getPlayer().getName())) {
plugin.logDebug("Ignore AdminChat message due to event cancellation: " + event.getMessage());
return;
}
}
if (event.getPlayer().hasPermission("irc.message.gamechat")) {
plugin.logDebug("Player " + event.getPlayer().getName() + " has permission irc.message.gamechat");

View File

@ -41,9 +41,13 @@ public class GriefPreventionHook {
public boolean isMuted(Player player) {
plugin.logDebug("GriefPrevention: " + player.getDisplayName());
if (gp != null) {
return gp.dataStore.isSoftMuted(player.getUniqueId());
try {
return gp.dataStore.isSoftMuted(player.getUniqueId());
} catch (Exception ex) {
plugin.logError(ex.getMessage());
}
}
return false;
}
}