twister: second fix for hardware map detection

When scanning ports the manufacture field is not always
filled. It must be checked before using.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This commit is contained in:
Grzegorz Chwierut 2023-12-20 09:51:01 +01:00 committed by Anas Nashif
parent 95f8c2666a
commit e9aa3e36a9

View file

@ -287,7 +287,7 @@ class HardwareMap:
serial_devices = list_ports.comports()
logger.info("Scanning connected hardware...")
for d in serial_devices:
if d.manufacturer.casefold() in [m.casefold() for m in self.manufacturer]:
if d.manufacturer and d.manufacturer.casefold() in [m.casefold() for m in self.manufacturer]:
# TI XDS110 can have multiple serial devices for a single board
# assume endpoint 0 is the serial, skip all others