Fix crash when extruder could not be found

Fixes #8891
This commit is contained in:
Jaime van Kessel 2020-12-07 16:45:28 +01:00
parent 19d432e50f
commit 7096f64ca2
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -344,7 +344,12 @@ class BuildVolume(SceneNode):
# Mark the node as outside build volume if the set extruder is disabled
extruder_position = node.callDecoration("getActiveExtruderPosition")
if not self._global_container_stack.extruderList[int(extruder_position)].isEnabled:
try:
if not self._global_container_stack.extruderList[int(extruder_position)].isEnabled:
node.setOutsideBuildArea(True)
return
except IndexError:
# If the extruder doesn't exist, also mark it as unprintable.
node.setOutsideBuildArea(True)
return