Skip to content

Commit

Permalink
NTRClient: Fixed instanceIsRunning NullPointerException
Browse files Browse the repository at this point in the history
(for real this time)
  • Loading branch information
ChainSwordCS committed Oct 8, 2024
1 parent 8c164c9 commit 2e557c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/chokistream/NTRClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2e557c2

Please sign in to comment.