mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 21:45:59 +08:00
Added handling for key not found in extruder map
This commit is contained in:
parent
3e3e6e6b1b
commit
ecbe4b264a
@ -51,7 +51,10 @@ class ExtruderManager(QObject):
|
|||||||
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.
|
||||||
|
try:
|
||||||
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
|
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…
x
Reference in New Issue
Block a user