From ff683ec0171db41bcd4119c48d793e7b2d0416e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0ach?= Date: Tue, 14 Jan 2025 15:14:29 +0100 Subject: [PATCH] Fix SPE-2638: do not acess opl->colors when mesh_info != Color (#13859) --- src/libslic3r/TriangleMeshSlicer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/TriangleMeshSlicer.cpp b/src/libslic3r/TriangleMeshSlicer.cpp index d52d126e7f..ecb9c821fd 100644 --- a/src/libslic3r/TriangleMeshSlicer.cpp +++ b/src/libslic3r/TriangleMeshSlicer.cpp @@ -1363,7 +1363,9 @@ static void chain_open_polylines_close_gaps(std::vector opl->points.pop_back(); } else { // The end points are different, keep both of them. - midpoint_inserted = handle_color_at_gap_between_open_polylines(*opl, opl->points.front(), opl->colors.front()); + if constexpr (mesh_info == AdditionalMeshInfo::Color) { + midpoint_inserted = handle_color_at_gap_between_open_polylines(*opl, opl->points.front(), opl->colors.front()); + } } // When we split the gap into two pieces by adding a midpoint, then a valid polygon has at least 4 points.