altosui: Handle a missing libaltos when starting up
authorKeith Packard <keithp@keithp.com>
Thu, 2 Jan 2014 06:00:24 +0000 (22:00 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 2 Jan 2014 06:00:24 +0000 (22:00 -0800)
Skip a null list of devices when figuring out what to open monitor
windows for during startup.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosUI.java

index 8d5cacd4cd31fbd329b6067063672994b193c857..50c5baabcd92146527d2b483bdf58721513b397e 100644 (file)
@@ -560,8 +560,9 @@ public class AltosUI extends AltosUIFrame {
                        AltosUI altosui = new AltosUI();
 
                        java.util.List<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
-                       for (AltosDevice device : devices)
-                               altosui.telemetry_window(device);
+                       if (devices != null)
+                               for (AltosDevice device : devices)
+                                       altosui.telemetry_window(device);
                } else {
                        int process = process_none;
                        for (int i = 0; i < args.length; i++) {