Don't emit changed signals if the global stack ID doesn't exist

Because nothing will change then.

This is equivalent to putting the call to self.__emitChangedSignals() in the if-statement. But I switched the condition of the if-statement around because it looks more like error handling to me. This is the main case.

Contributes to issue CURA-5045.
This commit is contained in:
Ghostkeeper 2018-03-27 09:41:14 +02:00
parent 75e993eb60
commit f2c8d8756e
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -326,7 +326,9 @@ class MachineManager(QObject):
container_registry = ContainerRegistry.getInstance() container_registry = ContainerRegistry.getInstance()
containers = container_registry.findContainerStacks(id = stack_id) containers = container_registry.findContainerStacks(id = stack_id)
if containers: if not containers:
return
global_stack = containers[0] global_stack = containers[0]
ExtruderManager.getInstance().setActiveExtruderIndex(0) # Switch to first extruder ExtruderManager.getInstance().setActiveExtruderIndex(0) # Switch to first extruder
self._global_container_stack = global_stack self._global_container_stack = global_stack