X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=micropeak%2FMicroDeviceDialog.java;h=d5fe326bddf70f739a3e1bdc43f6cf9966aa19b6;hp=7b8a630c83a8a24280b066855049e0fb13a0ba11;hb=HEAD;hpb=d83587c3c66b730cc54ca153714eee520ee40b2c diff --git a/micropeak/MicroDeviceDialog.java b/micropeak/MicroDeviceDialog.java index 7b8a630c..d5fe326b 100644 --- a/micropeak/MicroDeviceDialog.java +++ b/micropeak/MicroDeviceDialog.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,12 +22,21 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; -import org.altusmetrum.altosuilib.*; +import org.altusmetrum.altosuilib_14.*; public class MicroDeviceDialog extends AltosDeviceDialog { public AltosDevice[] devices() { java.util.List 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];