1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

avoid NPE if serial port gets discovered too early

This commit is contained in:
Martino Facchin 2016-01-04 16:06:36 +01:00
parent 7e17b5c318
commit 2a677b4bcd

View File

@ -154,8 +154,10 @@ public class SerialUploader extends Uploader {
}
BoardPort boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port"));
if (boardPort.getPrefs().get("iserial") != null) {
try {
prefs.put("serial.port.iserial", boardPort.getPrefs().get("iserial"));
} catch (Exception e) {
// if serial port does not contain an iserial field
}
prefs.put("build.path", buildPath);