Fix call to findContainerStack[s]

Was a typo. Now it also checks if the stack ID is correct here. Not because it went wrong, but for defensive programming.

Contributes to issue CURA-340.
This commit is contained in:
Ghostkeeper 2016-06-09 19:03:41 +02:00
parent f5f711b7dc
commit 9e86cd5c85
No known key found for this signature in database
GPG key ID: 701948C5954A7385

View file

@ -8,6 +8,7 @@ from UM.Signal import Signal, signalemitter
from UM.Settings.ContainerStack import ContainerStack
from UM.Settings.InstanceContainer import InstanceContainer
from UM.Settings.ContainerRegistry import ContainerRegistry
import UM.Logger
from UM.Application import Application
@ -58,7 +59,11 @@ class SettingOverrideDecorator(SceneNodeDecorator):
# kept up to date.
def _updateNextStack(self):
if self._extruder_stack:
self._stack.setNextStack(ContainerRegistry.getInstance().findContainerStack(id = self._extruder_stack))
extruder_stack = ContainerRegistry.getInstance().findContainerStacks(id = self._extruder_stack)
if extruder_stack:
self._stack.setNextStack(extruder_stack)
else:
UM.Logger.log("e", "Extruder stack %s below per-object settings does not exist.", self._extruder_stack)
else:
self._stack.setNextStack(Application.getInstance().getGlobalContainerStack())