Fixed NullPointerException for ChatLog module being disabled.

This commit is contained in:
sigonasr2 2017-11-05 10:29:07 -06:00
parent f86458f226
commit 6b76c8453c
4 changed files with 10 additions and 7 deletions

Binary file not shown.

View File

@ -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));
}
}
}

View File

@ -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;

View File

@ -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);
}
}