From ce618179fd70b3c01248ef3ab5831322e0a9e29f Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Wed, 28 Jun 2017 16:02:13 +0200 Subject: [PATCH] fixed nogui --- src/main/java/handiebot/HandieBot.java | 2 ++ src/main/java/handiebot/view/BotLog.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/handiebot/HandieBot.java b/src/main/java/handiebot/HandieBot.java index 969181a..ddb116f 100644 --- a/src/main/java/handiebot/HandieBot.java +++ b/src/main/java/handiebot/HandieBot.java @@ -89,7 +89,9 @@ public class HandieBot { if (args.length >= 1) { if (args[0].equalsIgnoreCase("-nogui")){ + System.out.println("Starting with no GUI."); USE_GUI = false; + log = new BotLog(null); } } diff --git a/src/main/java/handiebot/view/BotLog.java b/src/main/java/handiebot/view/BotLog.java index 5a0d111..74ebe4e 100644 --- a/src/main/java/handiebot/view/BotLog.java +++ b/src/main/java/handiebot/view/BotLog.java @@ -42,7 +42,9 @@ public class BotLog { public BotLog(JTextPane outputArea){ this.outputArea = outputArea; - initStyles(); + if (outputArea != null) { + initStyles(); + } } /**