mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-13 10:29:35 +01:00
avoid NPE in CLI mode (boardInfo not yet initialized)
This commit is contained in:
parent
243fc68763
commit
e23bbf76c1
@ -1122,7 +1122,9 @@ public class BaseNoGui {
|
||||
public static void selectSerialPort(String port) {
|
||||
PreferencesData.set("serial.port", port);
|
||||
BoardPort boardPort = getDiscoveryManager().find(port, true);
|
||||
PreferencesData.set("serial.port.iserial", boardPort.getPrefs().get("iserial"));
|
||||
if (boardPort != null) {
|
||||
PreferencesData.set("serial.port.iserial", boardPort.getPrefs().get("iserial"));
|
||||
}
|
||||
String portFile = port;
|
||||
if (port.startsWith("/dev/")) {
|
||||
portFile = portFile.substring(5);
|
||||
|
Loading…
x
Reference in New Issue
Block a user