From: Keith Packard Date: Thu, 25 Oct 2012 06:55:45 +0000 (-0700) Subject: altosui: Allow AltosConfig to abort before serial line starts X-Git-Tag: 1.1.9.2~31 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=978c16105dd334a4a2807140dbbcc7f306a6b581 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 --- 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()),