mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 19:45:57 +08:00
Ensure printers length is larger than 0 before accessing index
This commit is contained in:
parent
0028ec6746
commit
76d0b5f198
@ -244,9 +244,10 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
def _updatePrinters(self, printers: List[CloudClusterPrinterStatus]) -> None:
|
def _updatePrinters(self, printers: List[CloudClusterPrinterStatus]) -> None:
|
||||||
previous = {p.key: p for p in self._printers} # type: Dict[str, PrinterOutputModel]
|
previous = {p.key: p for p in self._printers} # type: Dict[str, PrinterOutputModel]
|
||||||
received = {p.uuid: p for p in printers} # type: Dict[str, CloudClusterPrinterStatus]
|
received = {p.uuid: p for p in printers} # type: Dict[str, CloudClusterPrinterStatus]
|
||||||
|
|
||||||
# We need the machine type of the host (1st list entry) to allow discovery to work.
|
if len(printers) > 0:
|
||||||
self._host_machine_type = printers[0].machine_variant
|
# We need the machine type of the host (1st list entry) to allow discovery to work.
|
||||||
|
self._host_machine_type = printers[0].machine_variant
|
||||||
|
|
||||||
removed_printers, added_printers, updated_printers = findChanges(previous, received)
|
removed_printers, added_printers, updated_printers = findChanges(previous, received)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user