mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 19:35:58 +08:00
Added handling for key not found in extruder map
This commit is contained in:
parent
3e3e6e6b1b
commit
ecbe4b264a
@ -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…
x
Reference in New Issue
Block a user