Fix crash when logger can't be found

This commit is contained in:
4pr0n 2015-02-20 07:36:12 -08:00
parent e06cd1213d
commit 8efdc9490c

View File

@ -763,8 +763,14 @@ public class MainWindow implements Runnable, RipStatusHandler {
} }
Logger.getRootLogger().setLevel(newLevel); Logger.getRootLogger().setLevel(newLevel);
logger.setLevel(newLevel); logger.setLevel(newLevel);
((ConsoleAppender)Logger.getRootLogger().getAppender("stdout")).setThreshold(newLevel); ConsoleAppender ca = (ConsoleAppender)Logger.getRootLogger().getAppender("stdout");
((FileAppender)Logger.getRootLogger().getAppender("FILE")).setThreshold(newLevel); if (ca != null) {
ca.setThreshold(newLevel);
}
FileAppender fa = (FileAppender)Logger.getRootLogger().getAppender("FILE");
if (fa != null) {
fa.setThreshold(newLevel);
}
} }
private void setupTrayIcon() { private void setupTrayIcon() {