receiver: add check for bad results from getting the usb device

This commit is contained in:
Peter F. Patel-Schneider 2020-01-26 10:09:12 -05:00 committed by Filipe Laíns
parent a6fcb75aa8
commit 1ab03d4c9f
1 changed files with 2 additions and 0 deletions

View File

@ -92,6 +92,8 @@ def _match(action, device, filter):
vid = usb_device.get('ID_VENDOR_ID')
pid = usb_device.get('ID_MODEL_ID')
if vid is None or pid is None:
return # there are reports that sometimes the usb_device isn't set up right so be defensive
if not ((vendor_id is None or vendor_id == int(vid, 16)) and
(product_id is None or product_id == int(pid, 16))):
return