mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 23:29:01 +08:00
Fix crash when layer does not exist
This commit is contained in:
parent
6a5fbba519
commit
043ef2e84f
@ -120,7 +120,10 @@ class SimulationPass(RenderPass):
|
|||||||
end = self._layer_view.end_elements_index
|
end = self._layer_view.end_elements_index
|
||||||
index = self._layer_view._current_path_num
|
index = self._layer_view._current_path_num
|
||||||
offset = 0
|
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
|
# The size indicates all values in the two-dimension array, and the second dimension is
|
||||||
# always size 3 because we have 3D points.
|
# always size 3 because we have 3D points.
|
||||||
if index >= polygon.data.size // 3 - offset:
|
if index >= polygon.data.size // 3 - offset:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user