diff options
author | Keith Packard <keithp@keithp.com> | 2012-10-24 23:55:45 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-10-25 00:07:14 -0700 |
commit | 978c16105dd334a4a2807140dbbcc7f306a6b581 (patch) | |
tree | d3cfcc26641e00df3dfe9babb7e696da6bed59e7 | |
parent | 055f3232decc07e064d596469b81cf9869411c2d (diff) |
altosui: Allow AltosConfig to abort before serial line starts
Check to see if the serial line is active before trying to close it.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosui/AltosConfig.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index 44c6239a..4b0edec0 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -393,8 +393,10 @@ public class AltosConfig implements ActionListener { } void abort() { - serial_line.close(); - serial_line = null; + if (serial_line != null) { + serial_line.close(); + serial_line = null; + } JOptionPane.showMessageDialog(owner, String.format("Connection to \"%s\" failed", device.toShortString()), |