X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosConfig.java;h=4b0edec0fbf5492aa48501c5e9ab2540f121d65c;hb=86f8b92149d1027b1d6d6b1cae097cfe47b02090;hp=be9ab8bf6b1f51a1e7a9d3b70b8c7aaf8b76b692;hpb=fe00d1169c65cb289f77093cf281efbd0a5d4e64;p=fw%2Faltos diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index be9ab8bf..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()), @@ -515,7 +517,7 @@ public class AltosConfig implements ActionListener { try { serial_line = new AltosSerial(device); try { - if (!device.matchProduct(Altos.product_altimeter)) + if (device.matchProduct(Altos.product_basestation)) remote = true; init_ui(); } catch (InterruptedException ie) {