Not getting any device list back from MicroUSB means the library
wasn't found, so pop up a dialog box explaining the situation.
Signed-off-by: Keith Packard <keithp@keithp.com>
public AltosDevice[] devices() {
java.util.List<MicroUSB> list = MicroUSB.list();
public AltosDevice[] devices() {
java.util.List<MicroUSB> list = MicroUSB.list();
+
+ if (list == null) {
+ JOptionPane.showMessageDialog(frame,
+ "libaltos failed to load",
+ "Helper Library Failed",
+ JOptionPane.ERROR_MESSAGE);
+ return new AltosDevice[0];
+ }
+
int num_devices = list.size();
AltosDevice[] devices = new AltosDevice[num_devices];
int num_devices = list.size();
AltosDevice[] devices = new AltosDevice[num_devices];