chiark / gitweb /
One extra test to make sure the result is not None
[cura.git] / Cura / gui / util / engineResultView.py
index 1554e32b41776c48a60152035dcb0733322a3958..91e047ab6e4235f573f2fa4fccdce96f45e2f17b 100644 (file)
@@ -82,7 +82,7 @@ class engineResultView(object):
                layerNr = self.layerSelect.getValue()
                if layerNr == self.layerSelect.getMaxValue() and result is not None and len(result._polygons) > 0:
                        layerNr = max(layerNr, len(result._polygons))
-               if len(result._polygons) > layerNr-1 and 'inset0' in result._polygons[layerNr-1] and len(result._polygons[layerNr-1]['inset0']) > 0 and len(result._polygons[layerNr-1]['inset0'][0]) > 0:
+               if result is not None and len(result._polygons) > layerNr-1 and 'inset0' in result._polygons[layerNr-1] and len(result._polygons[layerNr-1]['inset0']) > 0 and len(result._polygons[layerNr-1]['inset0'][0]) > 0:
                        viewZ = result._polygons[layerNr-1]['inset0'][0][0][2]
                else:
                        viewZ = (layerNr - 1) * profile.getProfileSettingFloat('layer_height') + profile.getProfileSettingFloat('bottom_thickness')