diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py index df28f511..6ccb6462 100644 --- a/lib/solaar/ui/tray.py +++ b/lib/solaar/ui/tray.py @@ -451,7 +451,7 @@ def _remove_receiver(receiver): def _update_menu_item(index, device): - if not device or device.status is None: + if device is None or device.status is None: _log.warn('updating an inactive device %s, assuming disconnected', device) return None diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py index eac98392..343374b5 100644 --- a/lib/solaar/ui/window.py +++ b/lib/solaar/ui/window.py @@ -886,7 +886,7 @@ def update(device, need_popup=False, refresh=False): _model.remove(item) else: - path = device.receiver.path if device.receiver else device.path + path = device.receiver.path if device.receiver is not None else device.path assert device.number is not None and device.number >= 0, 'invalid device number' + str(device.number) item = _device_row(path, device.number, device if bool(device) else None)