Browse Source

Fix rendering before the extruder number decoration is set

If a render is triggered before this decorator is set it would crash. The rest of the code is robust against this being None, but here it would give a TypeError.
Ghostkeeper 7 years ago
parent
commit
7d806e7ae9
1 changed files with 4 additions and 1 deletions
  1. 4 1
      plugins/SolidView/SolidView.py

+ 4 - 1
plugins/SolidView/SolidView.py

@@ -84,7 +84,10 @@ class SolidView(View):
 
                     per_mesh_stack = node.callDecoration("getStack")
 
-                    extruder_index = int(node.callDecoration("getActiveExtruderPosition"))
+                    extruder_index = node.callDecoration("getActiveExtruderPosition")
+                    if extruder_index is None:
+                        extruder_index = "0"
+                    extruder_index = int(extruder_index)
 
                     # Use the support extruder instead of the active extruder if this is a support_mesh
                     if per_mesh_stack: