From e76b9cc32bbcc5176d9bdd6f8d79778024627382 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 28 Jul 2010 12:24:53 -0700 Subject: 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 --- ao-tools/altosui/AltosSerial.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ao-tools/altosui/AltosSerial.java') 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(); } -- cgit v1.2.3