diff --git a/base.py b/base.py index 05bd62e..90cfa9e 100644 --- a/base.py +++ b/base.py @@ -15,7 +15,7 @@ from Scripts import shared, utils -CURRENT_VERSION = "0.0.4" +CURRENT_VERSION = "0.0.5" class Colors(Enum): diff --git a/debug_dump.py b/debug_dump.py index abbd244..9062aed 100644 --- a/debug_dump.py +++ b/debug_dump.py @@ -47,13 +47,15 @@ def build_dict(instance): for e in c.Win32_USBController(): controller = build_dict(e.PNPDeviceID) all_devices[e.PNPDeviceID] = dict(controller) - controller["root_hub"] = build_dict(controller[PnpDeviceProperties.BUS_RELATIONS.value][0]) - all_devices[controller[PnpDeviceProperties.BUS_RELATIONS.value][0]] = dict(controller["root_hub"]) - controller["root_hub"]["devices"] = {} - for f in controller["root_hub"].get(PnpDeviceProperties.BUS_RELATIONS.value, []): - controller["root_hub"]["devices"][f] = build_dict(f) - all_devices[f] = dict(controller["root_hub"]["devices"][f]) + if controller.get(PnpDeviceProperties.BUS_RELATIONS.value, None): + controller["root_hub"] = build_dict(controller[PnpDeviceProperties.BUS_RELATIONS.value][0]) + all_devices[controller[PnpDeviceProperties.BUS_RELATIONS.value][0]] = dict(controller["root_hub"]) + controller["root_hub"]["devices"] = {} + + for f in controller["root_hub"].get(PnpDeviceProperties.BUS_RELATIONS.value, []): + controller["root_hub"]["devices"][f] = build_dict(f) + all_devices[f] = dict(controller["root_hub"]["devices"][f]) controllers.append(controller) end = time.time()