An unknown device will not have a config; check for that before
showing radio calibration dialogs.
Signed-off-by: Keith Packard <keithp@keithp.com>
return false;
}
- if (existing_config.radio_calibration_broken) {
+ if (existing_config != null && existing_config.radio_calibration_broken) {
int ret = JOptionPane.showConfirmDialog(this,
String.format("Radio calibration value %d may be incorrect\nFlash anyways?",
existing_config.radio_calibration),
y++;
- if (AltosLib.has_radio(config.usb_id.pid)) {
+ if (config == null || AltosLib.has_radio(config.usb_id.pid)) {
/* Radio calibration value */
c = new GridBagConstraints();
c.gridx = 0; c.gridy = y;