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) {
for (String s : logContents) {
if (s!=null) {
if (ChatLogModule.chatlogmodule.messageHistory.size()>=ChatLogModule.messageHistoryCount) {
ChatLogModule.chatlogmodule.messageHistory.remove(0).cleanup();
if (sigIRC.chatlogmodule_enabled) {
for (String s : logContents) {
if (s!=null) {
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 boolean touhoumothermodule_enabled=false;
static boolean twitchmodule_enabled=true;
static boolean chatlogmodule_enabled=true;
public static boolean chatlogmodule_enabled=true;
static boolean downloadsComplete=false;
static boolean hardwareAcceleration=true;
static boolean playedoAuthSoundOnce=false;

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

Loading…
Cancel
Save