1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-13 10:29:35 +01:00

Avoid NPE and spurious unlock if serial monitor is clicked at upload warmup

This commit is contained in:
Martino Facchin 2019-07-22 14:50:10 +02:00
parent 13b74f5ccb
commit b2235c3a4a
2 changed files with 5 additions and 3 deletions

View File

@ -1927,7 +1927,9 @@ public class Base {
this.handleFontSizeChange(-1);
}
} else {
e.getComponent().getParent().dispatchEvent(e);
if (e.getComponent() != null && e.getComponent().getParent() != null) {
e.getComponent().getParent().dispatchEvent(e);
}
}
});
}

View File

@ -2060,6 +2060,8 @@ public class Editor extends JFrame implements RunnerListener {
public void run() {
try {
uploading = true;
removeAllLineHighlights();
if (serialMonitor != null) {
serialMonitor.suspend();
@ -2068,8 +2070,6 @@ public class Editor extends JFrame implements RunnerListener {
serialPlotter.suspend();
}
uploading = true;
boolean success = sketchController.exportApplet(usingProgrammer);
if (success) {
statusNotice(tr("Done uploading."));