Merge pull request #14636 from Ultimaker/CURA-10183_fix_gcode

[CURA-10183] Fix G-Code reader crash
This commit is contained in:
Remco Burema 2023-02-23 10:02:11 +01:00 committed by GitHub
commit 53eda4f1cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,7 +328,11 @@ class FlavorParser:
if not global_stack:
return None
try:
self._current_filament_diameter = global_stack.extruderList[self._extruder_number].getProperty("material_diameter", "value")
except IndexError:
# There can be a mismatch between the number of extruders in the G-Code file and the number of extruders in the current machine.
self._current_filament_diameter = self.DEFAULT_FILAMENT_DIAMETER
scene_node = CuraSceneNode()