mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
If opening serial monitor causes an error, set it closed. Fixes #3268
This commit is contained in:
parent
a859cfb9f9
commit
b77f5f731d
@ -2727,6 +2727,11 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")";
|
errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")";
|
||||||
}
|
}
|
||||||
statusError(errorMessage);
|
statusError(errorMessage);
|
||||||
|
try {
|
||||||
|
serialMonitor.close();
|
||||||
|
} catch (Exception e1) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusError(e);
|
statusError(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -99,8 +99,8 @@ public class SerialMonitor extends AbstractMonitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void close() throws Exception {
|
public void close() throws Exception {
|
||||||
|
super.close();
|
||||||
if (serial != null) {
|
if (serial != null) {
|
||||||
super.close();
|
|
||||||
int[] location = getPlacement();
|
int[] location = getPlacement();
|
||||||
String locationStr = PApplet.join(PApplet.str(location), ",");
|
String locationStr = PApplet.join(PApplet.str(location), ",");
|
||||||
PreferencesData.set("last.serial.location", locationStr);
|
PreferencesData.set("last.serial.location", locationStr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user