ui: fix device not always castable as bool
This commit is contained in:
parent
c1ce3c2c5f
commit
138fe4c756
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue