From 0bdd06735e81882c57e7ac1865ab2808cfc3c868 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 14 Dec 2016 11:52:02 +0100 Subject: [PATCH] Fixed another race condition that sometimes triggered when loading projects CURA-1263 --- plugins/SolidView/SolidView.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index 33c21acb08..8277813c92 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -86,8 +86,10 @@ class SolidView(View): extruder_id = node.callDecoration("getActiveExtruder") if extruder_id: extruder_index = max(0, self._extruders_model.find("id", extruder_id)) - - material_color = self._extruders_model.getItem(extruder_index)["color"] + try: + material_color = self._extruders_model.getItem(extruder_index)["color"] + except KeyError: + material_color = self._extruders_model.defaultColors[0] if extruder_index != ExtruderManager.getInstance().activeExtruderIndex: # Shade objects that are printed with the non-active extruder 25% darker