Avoid pointless traceback if vendor string is empty in user defined driver

This commit is contained in:
Kovid Goyal 2019-04-09 13:54:10 +05:30
parent 50f6f9ea8f
commit b1c0c59a2b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -95,6 +95,7 @@ class USER_DEFINED(USBMS):
def do_delayed_plugin_initialization(self):
try:
e = self.settings().extra_customization
if e[self.OPT_USB_VENDOR_ID]:
self.VENDOR_ID = int(e[self.OPT_USB_VENDOR_ID], 16)
self.PRODUCT_ID = int(e[self.OPT_USB_PRODUCT_ID], 16)
self.BCD = [int(e[self.OPT_USB_REVISION_ID], 16)]
@ -151,5 +152,3 @@ class USER_DEFINED(USBMS):
names['carda'] = main
return names