mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Added handling for key not found in extruder map
This commit is contained in:
parent
3e3e6e6b1b
commit
ecbe4b264a
1 changed files with 5 additions and 2 deletions
|
@ -50,8 +50,11 @@ class ExtruderManager(QObject):
|
||||||
@pyqtProperty(int, notify = extrudersChanged)
|
@pyqtProperty(int, notify = extrudersChanged)
|
||||||
def extruderCount(self):
|
def extruderCount(self):
|
||||||
if not UM.Application.getInstance().getGlobalContainerStack():
|
if not UM.Application.getInstance().getGlobalContainerStack():
|
||||||
return 0 # No active machine, so no extruders.
|
return 0 # No active machine, so no extruders.
|
||||||
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
|
try:
|
||||||
|
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
|
||||||
|
except KeyError:
|
||||||
|
return 0
|
||||||
|
|
||||||
@pyqtProperty("QVariantMap", notify=extrudersChanged)
|
@pyqtProperty("QVariantMap", notify=extrudersChanged)
|
||||||
def extruderIds(self):
|
def extruderIds(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue