diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 72e7d539ce..8374bddf74 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -6,6 +6,7 @@ import math from typing import List, Optional, TYPE_CHECKING, Any, Set, cast, Iterable, Dict +from UM.Logger import Logger from UM.Mesh.MeshData import MeshData from UM.Mesh.MeshBuilder import MeshBuilder @@ -1078,7 +1079,11 @@ class BuildVolume(SceneNode): # setting does *not* have a limit_to_extruder setting (which means that we can't ask the global extruder what # the value is. adhesion_extruder = self._global_container_stack.getProperty("adhesion_extruder_nr", "value") - adhesion_stack = self._global_container_stack.extruderList[int(adhesion_extruder)] + try: + adhesion_stack = self._global_container_stack.extruderList[int(adhesion_extruder)] + except IndexError: + Logger.warning(f"Couldn't find extruder with index '{adhesion_extruder}', defaulting to 0 instead.") + adhesion_stack = self._global_container_stack.extruderList[0] skirt_brim_line_width = adhesion_stack.getProperty("skirt_brim_line_width", "value") initial_layer_line_width_factor = adhesion_stack.getProperty("initial_layer_line_width_factor", "value")