mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 01:07:52 -06:00
Explicitly return None if no global container stack
That's what it does. This is more clear than doing 'pass' or something. Contributes to issues CURA-340 and CURA-1278.
This commit is contained in:
parent
d1be5b6c02
commit
70e6c8093e
1 changed files with 6 additions and 5 deletions
|
@ -51,11 +51,12 @@ class ExtruderManager(QObject):
|
|||
|
||||
@pyqtProperty(str, notify = activeExtruderChanged)
|
||||
def activeExtruderStackId(self):
|
||||
if UM.Application.getInstance().getGlobalContainerStack():
|
||||
try:
|
||||
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)]
|
||||
except KeyError:
|
||||
pass
|
||||
if not UM.Application.getInstance().getGlobalContainerStack():
|
||||
return None #Whatta ya gonna do?
|
||||
try:
|
||||
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)]
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
@pyqtSlot(int)
|
||||
def setActiveExtruderIndex(self, index):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue