Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2022-05-31 12:23:53 +0300
committerGhostkeeper <rubend@tutanota.com>2022-05-31 12:24:08 +0300
commit35147d7f5edc9947470439e123cff09e9b87d697 (patch)
treea6628f9d40cf03686db20817932b5aaa81ed8357 /cura/Settings
parent097cc9388a400b071735bd0cab8f10d790f1bd20 (diff)
Don't crash if machine_extruder_trains metadata is missing
This old function is only necessary for upgrading from before v3.4. Best not let it crash in any other case, even if that would sometimes make very old machine instances corrupt if I made a mistake in thinking here. Fixes Sentry issue CURA-3XG.
Diffstat (limited to 'cura/Settings')
-rwxr-xr-xcura/Settings/ExtruderManager.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py
index 07c074254f..8d46ac41d8 100755
--- a/cura/Settings/ExtruderManager.py
+++ b/cura/Settings/ExtruderManager.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Ultimaker B.V.
+# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt6.QtCore import pyqtSignal, pyqtProperty, QObject, QVariant # For communicating data and events to Qt.
@@ -382,7 +382,10 @@ class ExtruderManager(QObject):
# "fdmextruder". We need to check a machine here so its extruder definition is correct according to this.
def fixSingleExtrusionMachineExtruderDefinition(self, global_stack: "GlobalStack") -> None:
container_registry = ContainerRegistry.getInstance()
- expected_extruder_definition_0_id = global_stack.getMetaDataEntry("machine_extruder_trains")["0"]
+ expected_extruder_stack = global_stack.getMetadataEntry("machine_extruder_trains")
+ if expected_extruder_stack is None:
+ return
+ expected_extruder_definition_0_id = expected_extruder_stack["0"]
try:
extruder_stack_0 = global_stack.extruderList[0]
except IndexError: