mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:49:04 +08:00
Prevent crash when cloud printer gets added while trying to connect to active printers
The cloud printers get added asynchronously, which could lead to a crash because the dict gets modified while we're iterating over it. Fixes Sentry issue CURA-2EN.
This commit is contained in:
parent
5252d53187
commit
788efcc83e
@ -399,7 +399,7 @@ class CloudOutputDeviceManager:
|
||||
output_device_manager = CuraApplication.getInstance().getOutputDeviceManager()
|
||||
stored_cluster_id = active_machine.getMetaDataEntry(self.META_CLUSTER_ID)
|
||||
local_network_key = active_machine.getMetaDataEntry(self.META_NETWORK_KEY)
|
||||
for device in self._remote_clusters.values():
|
||||
for device in list(self._remote_clusters.values()): # Make a copy of the remote devices list, to prevent modifying the list while iterating, if a device gets added asynchronously.
|
||||
if device.key == stored_cluster_id:
|
||||
# Connect to it if the stored ID matches.
|
||||
self._connectToOutputDevice(device, active_machine)
|
||||
|
Loading…
x
Reference in New Issue
Block a user