chiark / gitweb /
Fix the exception when there is no engine result and one opens the layer view.
[cura.git] / Cura / gui / util / engineResultView.py
index 9fa2ff2685ef16e805792363dded8d0a2bccc42f..67ceb53dfa1c965cd3c63caeb074a9d20c8586b0 100644 (file)
@@ -71,7 +71,7 @@ class engineResultView(object):
                glLineWidth(2)
 
                layerNr = self.layerSelect.getValue()
-               if layerNr == self.layerSelect.getMaxValue():
+               if layerNr == self.layerSelect.getMaxValue() and result is not None:
                        layerNr = max(layerNr, len(result._polygons))
                viewZ = (layerNr - 1) * profile.getProfileSettingFloat('layer_height') + profile.getProfileSettingFloat('bottom_thickness')
                self._parent._viewTarget[2] = viewZ