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.
This commit is contained in:
Ghostkeeper 2018-04-11 11:59:54 +02:00
parent 4e625da168
commit 7d806e7ae9
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -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: