1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-15 12:29:26 +01:00

avoid NPE if serial monitor is waiting too long for opening

This commit is contained in:
Martino Facchin 2016-02-23 15:59:21 +01:00
parent 821c665460
commit 52ef55380d

View File

@ -2442,13 +2442,14 @@ public class Editor extends JFrame implements RunnerListener {
} }
} }
try { try {
if (serialMonitor != null) if (serialMonitor != null) {
serialMonitor.resume(boardPort);
if (boardPort == null) {
serialMonitor.close();
handleSerial();
} else {
serialMonitor.resume(boardPort); serialMonitor.resume(boardPort);
if (boardPort == null) {
serialMonitor.close();
handleSerial();
} else {
serialMonitor.resume(boardPort);
}
} }
} catch (Exception e) { } catch (Exception e) {
statusError(e); statusError(e);