Skip to content

Commit e23bbf7

Browse files
committed
avoid NPE in CLI mode (boardInfo not yet initialized)
1 parent 243fc68 commit e23bbf7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arduino-core/src/processing/app/BaseNoGui.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,9 @@ static public void selectBoard(TargetBoard targetBoard) {
11221122
public static void selectSerialPort(String port) {
11231123
PreferencesData.set("serial.port", port);
11241124
BoardPort boardPort = getDiscoveryManager().find(port, true);
1125-
PreferencesData.set("serial.port.iserial", boardPort.getPrefs().get("iserial"));
1125+
if (boardPort != null) {
1126+
PreferencesData.set("serial.port.iserial", boardPort.getPrefs().get("iserial"));
1127+
}
11261128
String portFile = port;
11271129
if (port.startsWith("/dev/")) {
11281130
portFile = portFile.substring(5);

0 commit comments

Comments
 (0)