Skip to content

Commit b2235c3

Browse files
committed
Avoid NPE and spurious unlock if serial monitor is clicked at upload warmup
1 parent 13b74f5 commit b2235c3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/src/processing/app/Base.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,9 @@ public void addEditorFontResizeMouseWheelListener(Component comp) {
19271927
this.handleFontSizeChange(-1);
19281928
}
19291929
} else {
1930-
e.getComponent().getParent().dispatchEvent(e);
1930+
if (e.getComponent() != null && e.getComponent().getParent() != null) {
1931+
e.getComponent().getParent().dispatchEvent(e);
1932+
}
19311933
}
19321934
});
19331935
}

app/src/processing/app/Editor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2060,6 +2060,8 @@ public void setUsingProgrammer(boolean usingProgrammer) {
20602060

20612061
public void run() {
20622062
try {
2063+
uploading = true;
2064+
20632065
removeAllLineHighlights();
20642066
if (serialMonitor != null) {
20652067
serialMonitor.suspend();
@@ -2068,8 +2070,6 @@ public void run() {
20682070
serialPlotter.suspend();
20692071
}
20702072

2071-
uploading = true;
2072-
20732073
boolean success = sketchController.exportApplet(usingProgrammer);
20742074
if (success) {
20752075
statusNotice(tr("Done uploading."));

0 commit comments

Comments
 (0)