From 8efdc9490c110ff0b496ca54f4e3dc48cf64871e Mon Sep 17 00:00:00 2001 From: 4pr0n Date: Fri, 20 Feb 2015 07:36:12 -0800 Subject: [PATCH] Fix crash when logger can't be found --- src/main/java/com/rarchives/ripme/ui/MainWindow.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ui/MainWindow.java b/src/main/java/com/rarchives/ripme/ui/MainWindow.java index a33e8459..8b9a7826 100644 --- a/src/main/java/com/rarchives/ripme/ui/MainWindow.java +++ b/src/main/java/com/rarchives/ripme/ui/MainWindow.java @@ -763,8 +763,14 @@ public class MainWindow implements Runnable, RipStatusHandler { } Logger.getRootLogger().setLevel(newLevel); logger.setLevel(newLevel); - ((ConsoleAppender)Logger.getRootLogger().getAppender("stdout")).setThreshold(newLevel); - ((FileAppender)Logger.getRootLogger().getAppender("FILE")).setThreshold(newLevel); + ConsoleAppender ca = (ConsoleAppender)Logger.getRootLogger().getAppender("stdout"); + if (ca != null) { + ca.setThreshold(newLevel); + } + FileAppender fa = (FileAppender)Logger.getRootLogger().getAppender("FILE"); + if (fa != null) { + fa.setThreshold(newLevel); + } } private void setupTrayIcon() {