Skip to content

Commit 5a2dfa4

Browse files
committed
avoid NPE if serial monitor is waiting too long for opening
1 parent f38056c commit 5a2dfa4

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
@@ -2435,13 +2435,14 @@ private void resumeOrCloseSerialMonitor() {
24352435
}
24362436
}
24372437
try {
2438-
if (serialMonitor != null)
2439-
serialMonitor.resume(boardPort);
2440-
if (boardPort == null) {
2441-
serialMonitor.close();
2442-
handleSerial();
2443-
} else {
2438+
if (serialMonitor != null) {
24442439
serialMonitor.resume(boardPort);
2440+
if (boardPort == null) {
2441+
serialMonitor.close();
2442+
handleSerial();
2443+
} else {
2444+
serialMonitor.resume(boardPort);
2445+
}
24452446
}
24462447
} catch (Exception e) {
24472448
statusError(e);

0 commit comments

Comments
 (0)