Fix AttributeError when subid is already numeric. Fixes #37

This commit is contained in:
Markus Birth 2024-05-27 01:42:07 +01:00
parent a7ad1934dd
commit 78bf933290
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -14,7 +14,7 @@
def get_name(hwid, subid, default=None):
global DEVICES
hwid = int(hwid)
if subid.isnumeric():
if type(subid) is str and subid.isnumeric():
subid = int(subid)
return DEVICES.get(hwid, {subid: default}).get(subid, default)