summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosSerial.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-07-28 12:24:53 -0700
committerKeith Packard <keithp@keithp.com>2010-07-28 12:24:53 -0700
commite76b9cc32bbcc5176d9bdd6f8d79778024627382 (patch)
tree331a16ed7d14f8362dc85af04dcf1693b3b1ee6e /ao-tools/altosui/AltosSerial.java
parent172a2817dde6718724f2b5fad5a7761801446fa0 (diff)
altosui: Catch errors opening USB devices. Limit list to relevant devices
Avoids a segfault when failing to open a device. Limit listed telemetry devices to just TeleDongle units. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosSerial.java')
-rw-r--r--ao-tools/altosui/AltosSerial.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java
index e84f5b63..b016c1d6 100644
--- a/ao-tools/altosui/AltosSerial.java
+++ b/ao-tools/altosui/AltosSerial.java
@@ -134,6 +134,8 @@ public class AltosSerial implements Runnable {
public void open(altos_device device) throws FileNotFoundException {
close();
altos = libaltos.altos_open(device);
+ if (altos == null)
+ throw new FileNotFoundException(device.getPath());
input_thread = new Thread(this);
input_thread.start();
}