When messing with TD, I hit a couple of paths that could try to
dereference null pointers. Check for those.
Signed-off-by: Keith Packard <keithp@keithp.com>
if (!config_version.get().equals("0.0"))
break;
been_there = true;
if (!config_version.get().equals("0.0"))
break;
been_there = true;
- config.serial_line.printf("C\n ");
- config.serial_line.flush_input();
+ if (config != null && config.serial_line != null) {
+ config.serial_line.printf("C\n ");
+ config.serial_line.flush_input();
+ }
}
} catch (InterruptedException ie) {
}
}
} catch (InterruptedException ie) {
}
- serial_line.close();
- serial_line = null;
+ if (serial_line != null) {
+ serial_line.close();
+ serial_line = null;
+ }
JOptionPane.showMessageDialog(owner,
String.format("Connection to \"%s\" failed",
device.toShortString()),
JOptionPane.showMessageDialog(owner,
String.format("Connection to \"%s\" failed",
device.toShortString()),