Fixed NullPointerException for ChatLog module being disabled.

dev
sigonasr2 7 years ago
parent f86458f226
commit 6b76c8453c
  1. BIN
      sigIRCv2.jar
  2. 12
      src/sig/modules/ChatLog/ChatLogMessage.java
  3. 2
      src/sig/sigIRC.java
  4. 3
      src/sig/utils/FileUtils.java

Binary file not shown.

@ -225,12 +225,14 @@ public class ChatLogMessage {
} }
public static void importMessages(String...logContents) { public static void importMessages(String...logContents) {
for (String s : logContents) { if (sigIRC.chatlogmodule_enabled) {
if (s!=null) { for (String s : logContents) {
if (ChatLogModule.chatlogmodule.messageHistory.size()>=ChatLogModule.messageHistoryCount) { if (s!=null) {
ChatLogModule.chatlogmodule.messageHistory.remove(0).cleanup(); if (ChatLogModule.chatlogmodule.messageHistory.size()>=ChatLogModule.messageHistoryCount) {
ChatLogModule.chatlogmodule.messageHistory.remove(0).cleanup();
}
ChatLogModule.chatlogmodule.messageHistory.add(new ChatLogMessage(s));
} }
ChatLogModule.chatlogmodule.messageHistory.add(new ChatLogMessage(s));
} }
} }
} }

@ -96,7 +96,7 @@ public class sigIRC{
static String touhoumotherConsoleFont="Agency FB Bold"; static String touhoumotherConsoleFont="Agency FB Bold";
static boolean touhoumothermodule_enabled=false; static boolean touhoumothermodule_enabled=false;
static boolean twitchmodule_enabled=true; static boolean twitchmodule_enabled=true;
static boolean chatlogmodule_enabled=true; public static boolean chatlogmodule_enabled=true;
static boolean downloadsComplete=false; static boolean downloadsComplete=false;
static boolean hardwareAcceleration=true; static boolean hardwareAcceleration=true;
static boolean playedoAuthSoundOnce=false; static boolean playedoAuthSoundOnce=false;

@ -21,6 +21,7 @@ import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import sig.sigIRC;
import sig.modules.ChatLog.ChatLogMessage; import sig.modules.ChatLog.ChatLogMessage;
public class FileUtils { public class FileUtils {
@ -256,7 +257,7 @@ public class FileUtils {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (outputToChatLog) { if (outputToChatLog && sigIRC.chatlogmodule_enabled) {
ChatLogMessage.importMessages(message); ChatLogMessage.importMessages(message);
} }
} }

Loading…
Cancel
Save