mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue