Fix SPE-2638: do not acess opl->colors when mesh_info != Color (#13859)

This commit is contained in:
Martin Šach 2025-01-14 15:14:29 +01:00 committed by Lukas Matena
parent c540bda309
commit ff683ec017

View File

@ -1363,7 +1363,9 @@ static void chain_open_polylines_close_gaps(std::vector<OpenPolyline>
opl->points.pop_back();
} else {
// The end points are different, keep both of them.
midpoint_inserted = handle_color_at_gap_between_open_polylines<mesh_info>(*opl, opl->points.front(), opl->colors.front());
if constexpr (mesh_info == AdditionalMeshInfo::Color) {
midpoint_inserted = handle_color_at_gap_between_open_polylines<mesh_info>(*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.