mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix crash while reading 3mf if extruder list is empty
CURA-7527
This commit is contained in:
parent
79cc6ec897
commit
572ded8c95
1 changed files with 12 additions and 3 deletions
|
@ -819,7 +819,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
extruder_stack = None
|
||||
intent_category = None # type: Optional[str]
|
||||
if position is not None:
|
||||
extruder_stack = global_stack.extruderList[int(position)]
|
||||
try:
|
||||
extruder_stack = global_stack.extruderList[int(position)]
|
||||
except IndexError:
|
||||
pass
|
||||
intent_category = quality_changes_intent_category_per_extruder[position]
|
||||
container = self._createNewQualityChanges(quality_changes_quality_type, intent_category, quality_changes_name, global_stack, extruder_stack)
|
||||
container_info.container = container
|
||||
|
@ -849,7 +852,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
# it might not have its extruders set properly.
|
||||
if len(global_stack.extruderList) == 0:
|
||||
ExtruderManager.getInstance().fixSingleExtrusionMachineExtruderDefinition(global_stack)
|
||||
extruder_stack = global_stack.extruderList[0]
|
||||
try:
|
||||
extruder_stack = global_stack.extruderList[0]
|
||||
except IndexError:
|
||||
extruder_stack = None
|
||||
intent_category = quality_changes_intent_category_per_extruder["0"]
|
||||
|
||||
container = self._createNewQualityChanges(quality_changes_quality_type, intent_category, quality_changes_name, global_stack, extruder_stack)
|
||||
|
@ -878,7 +884,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
continue
|
||||
|
||||
if container_info.container is None:
|
||||
extruder_stack = global_stack.extruderList[int(position)]
|
||||
try:
|
||||
extruder_stack = global_stack.extruderList[int(position)]
|
||||
except IndexError:
|
||||
extruder_stack = None
|
||||
intent_category = quality_changes_intent_category_per_extruder[position]
|
||||
container = self._createNewQualityChanges(quality_changes_quality_type, intent_category, quality_changes_name, global_stack, extruder_stack)
|
||||
container_info.container = container
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue