Fix T99761: Curves sculpt mode crash with empty curves

The virtual arrays may be null if the curves are empty,
it's simple to just skip the domain interpolation completely.
This commit is contained in:
Hans Goudey 2022-07-28 17:39:10 -05:00
parent 1adeae56e6
commit 6ca602dd9f
Notes: blender-bot 2023-02-14 03:21:27 +01:00
Referenced by issue #99761, New Empty hair curves object - crash to desktop with using hotkey 2 in the sculpt mode
1 changed files with 3 additions and 0 deletions

View File

@ -755,6 +755,9 @@ static int curves_set_selection_domain_exec(bContext *C, wmOperator *op)
CurvesGeometry &curves = CurvesGeometry::wrap(curves_id->geometry);
bke::MutableAttributeAccessor attributes = curves.attributes_for_write();
if (curves.points_num() == 0) {
continue;
}
if (old_domain == ATTR_DOMAIN_POINT && domain == ATTR_DOMAIN_CURVE) {
VArray<float> curve_selection = curves.adapt_domain(