Fix crash on no output devices in list.

This commit is contained in:
Remco Burema 2019-02-12 11:39:03 +01:00
parent 14c361a297
commit c50fcf42c5

View file

@ -519,13 +519,13 @@ class MachineManager(QObject):
@pyqtProperty(str, notify = globalContainerChanged)
def activeMachineFirmwareVersion(self) -> str:
if not self._printer_output_devices[0]:
if not self._printer_output_devices:
return ""
return self._printer_output_devices[0].firmwareVersion
@pyqtProperty(str, notify = globalContainerChanged)
def activeMachineAddress(self) -> str:
if not self._printer_output_devices[0]:
if not self._printer_output_devices:
return ""
return self._printer_output_devices[0].address