mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-01 03:47:23 +03:00
Fixed NPE during VID/PID discovery for non-USB serial ports
This commit is contained in:
@ -10,7 +10,11 @@ public class UDevAdmParser {
|
|||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.load(new StringReader(output));
|
properties.load(new StringReader(output));
|
||||||
|
|
||||||
return ("0x" + properties.get("ID_VENDOR_ID").toString() + "_0x" + properties.get("ID_MODEL_ID").toString()).toUpperCase();
|
Object vid = properties.get("ID_VENDOR_ID");
|
||||||
|
Object pid = properties.get("ID_MODEL_ID");
|
||||||
|
if (vid == null || pid == null)
|
||||||
|
return null;
|
||||||
|
return ("0x" + vid + "_0x" + pid).toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user