diff --git a/src/main/java/carpet/commands/LogCommand.java b/src/main/java/carpet/commands/LogCommand.java index d1b06265..6fe73a58 100644 --- a/src/main/java/carpet/commands/LogCommand.java +++ b/src/main/java/carpet/commands/LogCommand.java @@ -153,8 +153,7 @@ private static int unsubFromLogger(CommandSource source, String player_name, Str Messenger.m(source, "r No player specified"); return 0; } - Logger log = LoggerRegistry.getLogger(logname); - if (log == null) + if (LoggerRegistry.getLogger(logname) == null) { Messenger.m(source, "r Unknown logger: ","rb "+logname); return 0; @@ -172,6 +171,11 @@ private static int toggleSubscription(CommandSource source, String player_name, Messenger.m(source, "r No player specified"); return 0; } + if (LoggerRegistry.getLogger(logName) == null) + { + Messenger.m(source, "r Unknown logger: ","rb "+logName); + return 0; + } boolean subscribed = LoggerRegistry.togglePlayerSubscription(player_name, logName); if (subscribed) { @@ -191,6 +195,11 @@ private static int subscribePlayer(CommandSource source, String player_name, Str Messenger.m(source, "r No player specified"); return 0; } + if (LoggerRegistry.getLogger(logname) == null) + { + Messenger.m(source, "r Unknown logger: ","rb "+logname); + return 0; + } LoggerRegistry.subscribePlayer(player_name, logname, option); if (option!=null) {