An unknown device will not have a config; check for that before
showing radio calibration dialogs.
Signed-off-by: Keith Packard <keithp@keithp.com>
- 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),
int ret = JOptionPane.showConfirmDialog(this,
String.format("Radio calibration value %d may be incorrect\nFlash anyways?",
existing_config.radio_calibration),
- 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;
/* Radio calibration value */
c = new GridBagConstraints();
c.gridx = 0; c.gridy = y;