From aaffcbc282d5e67b75b35c175d40010b3bc4a639 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Mon, 6 Feb 2023 16:52:09 +0100 Subject: [PATCH] Fixed crash in Organic supports with a single support layer only. Fixes #9557 --- src/libslic3r/TreeSupport.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/TreeSupport.cpp b/src/libslic3r/TreeSupport.cpp index cbb779be0..713a0c1c4 100644 --- a/src/libslic3r/TreeSupport.cpp +++ b/src/libslic3r/TreeSupport.cpp @@ -2500,8 +2500,10 @@ static void create_nodes_from_area( // Point is chosen based on an inaccurate estimate where the branches will split into two, but every point inside the influence area would produce a valid result. { SupportElements *layer_above = move_bounds.size() > 1 ? &move_bounds[1] : nullptr; - for (SupportElement &elem : *layer_above) - elem.state.marked = false; + if (layer_above) { + for (SupportElement &elem : *layer_above) + elem.state.marked = false; + } for (SupportElement &init : move_bounds.front()) { init.state.result_on_layer = move_inside_if_outside(init.influence_area, init.state.next_position); // Also set the parent nodes, as these will be required for the first iteration of the loop below and mark the parent nodes.