From 043ef2e84f973096da56628af72b02b5b7c43119 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 6 Jan 2020 10:47:47 +0100 Subject: [PATCH] Fix crash when layer does not exist --- plugins/SimulationView/SimulationPass.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/SimulationView/SimulationPass.py b/plugins/SimulationView/SimulationPass.py index b49d06722e..4e4f1e49df 100644 --- a/plugins/SimulationView/SimulationPass.py +++ b/plugins/SimulationView/SimulationPass.py @@ -120,7 +120,10 @@ class SimulationPass(RenderPass): end = self._layer_view.end_elements_index index = self._layer_view._current_path_num offset = 0 - for polygon in layer_data.getLayer(self._layer_view._current_layer_num).polygons: + layer = layer_data.getLayer(self._layer_view._current_layer_num) + if layer is None: + continue + for polygon in layer.polygons: # The size indicates all values in the two-dimension array, and the second dimension is # always size 3 because we have 3D points. if index >= polygon.data.size // 3 - offset: