mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Fixed NPE during VID/PID discovery for non-USB serial ports
This commit is contained in:
parent
ae222c10e7
commit
a9e6397e2e
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user