From 2c3bd59af3efb676830e2817f153a1890c325b64 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Fri, 8 Nov 2024 22:28:46 +0700 Subject: [PATCH] Added check for device id to ensure valid lookup --- Scripts/platforms/windows.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Scripts/platforms/windows.py b/Scripts/platforms/windows.py index 5ab0feb..3b59fa0 100755 --- a/Scripts/platforms/windows.py +++ b/Scripts/platforms/windows.py @@ -96,11 +96,12 @@ class WindowsHardwareInfo: if pnp_device_id: device_info = self.parse_device_path(pnp_device_id) - - if device_class in "Unknown": - device_class = self.unknown_class_device(device_info.get("Device ID")) - elif device_class in "System" and chipset_data.chipset_controllers.get(device_info.get("Device ID")): - self.chipset_model = chipset_data.chipset_controllers.get(device_info.get("Device ID")) + + if device_info.get("Device ID"): + if device_class in "Unknown": + device_class = self.unknown_class_device(device_info.get("Device ID")) + elif device_class in "System" and chipset_data.chipset_controllers.get(device_info.get("Device ID")): + self.chipset_model = chipset_data.chipset_controllers.get(device_info.get("Device ID")) if device_class in self.devices_by_class: self.devices_by_class[device_class].append(device)