chiark / gitweb /
Merge branch 'SteamEngine' of https://github.com/daid/Cura into SteamEngine
[cura.git] / Cura / gui / util / engineResultView.py
index 599ae4c324ccca81cbadce82d4664c42dae85a27..02a5cf3b65f138a5051209d0cd5e866c281d2483 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
@@ -284,4 +284,4 @@ class engineResultView(object):
                                self.layerSelect.setValue(self.layerSelect.getValue() - 10)
                                self._parent.QueueRefresh()
                                return True
-               return False
\ No newline at end of file
+               return False