Skip to content

Commit 52ef553

Browse files
committed
avoid NPE if serial monitor is waiting too long for opening
1 parent 821c665 commit 52ef553

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/src/processing/app/Editor.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,13 +2442,14 @@ private void resumeOrCloseSerialMonitor() {
24422442
}
24432443
}
24442444
try {
2445-
if (serialMonitor != null)
2446-
serialMonitor.resume(boardPort);
2447-
if (boardPort == null) {
2448-
serialMonitor.close();
2449-
handleSerial();
2450-
} else {
2445+
if (serialMonitor != null) {
24512446
serialMonitor.resume(boardPort);
2447+
if (boardPort == null) {
2448+
serialMonitor.close();
2449+
handleSerial();
2450+
} else {
2451+
serialMonitor.resume(boardPort);
2452+
}
24522453
}
24532454
} catch (Exception e) {
24542455
statusError(e);

0 commit comments

Comments
 (0)