From 2e557c2111935439200e84b219add010ff49db7e Mon Sep 17 00:00:00 2001 From: ChainSwordCS Date: Tue, 8 Oct 2024 15:57:38 -0400 Subject: [PATCH] NTRClient: Fixed instanceIsRunning NullPointerException (for real this time) --- src/main/java/chokistream/NTRClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/chokistream/NTRClient.java b/src/main/java/chokistream/NTRClient.java index ce95448..27539d9 100644 --- a/src/main/java/chokistream/NTRClient.java +++ b/src/main/java/chokistream/NTRClient.java @@ -51,7 +51,7 @@ public class NTRClient implements StreamingInterface { * and preferably in a way that doesn't rely on * only one instance of NTRClient running at a time. */ - public static AtomicBoolean instanceIsRunning; + public static AtomicBoolean instanceIsRunning = new AtomicBoolean(false); /** Thread used by NTRClient to read and buffer Frames received from the 3DS. */ private final NTRUDPThread udpThread; @@ -480,7 +480,7 @@ public static void queueNFCPatch(NFCPatchType ver) { logger.log("NTR NFC Patch un-queued"); } else { // this check is unnecessary - if((instanceIsRunning == null) || !instanceIsRunning.get()) { + if(!instanceIsRunning.get()) { logger.log("NTR NFC Patch queued"); } } @@ -582,7 +582,7 @@ public void changeSettingsWhileRunning(int quality, DSScreen screen, int priorit */ public static void queueSettingsChange(int quality, DSScreen screen, int priority, int qos) { // The queue system is robust enough to handle it gracefully, so this check is redundant (for now) - if((instanceIsRunning != null) && instanceIsRunning.get()) { + if(instanceIsRunning.get()) { scq.quality = quality; scq.screen = screen; scq.priority = priority;