Fix: crash duplicating empty hair

Attempt to access `points_by_curve.data().last()` on an empty array
crashed on a null pointer dereference.

Ref !135956
This commit is contained in:
Campbell Barton
2025-03-14 13:47:10 +11:00
parent dd3640ef0f
commit 8faf210e4e

View File

@@ -116,6 +116,9 @@ static void curve_offsets_from_selection(const Span<IndexRange> selected_points,
void duplicate_points(bke::CurvesGeometry &curves, const IndexMask &mask)
{
if (curves.is_empty()) {
return;
}
const OffsetIndices<int> points_by_curve = curves.points_by_curve();
const VArray<bool> src_cyclic = curves.cyclic();