From 3237c6dbe877db1cfbe15e92f6cb267d8a6031ea Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sat, 25 Jun 2022 19:17:08 +0200 Subject: [PATCH] Fix: crash when converting zero legacy curves The issue was that the "radius" lookup below fails, because there is no curve data. Arguably, it should be possible to add attributes even when there is no data. However, the rules for that are a bit loose currently. A simple fix is to just not run the conversion code when there is nothing to convert. --- source/blender/blenkernel/intern/curve_legacy_convert.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/blenkernel/intern/curve_legacy_convert.cc b/source/blender/blenkernel/intern/curve_legacy_convert.cc index 62e89d8be80..193a292994d 100644 --- a/source/blender/blenkernel/intern/curve_legacy_convert.cc +++ b/source/blender/blenkernel/intern/curve_legacy_convert.cc @@ -105,6 +105,10 @@ Curves *curve_legacy_to_curves(const Curve &curve_legacy, const ListBase &nurbs_ curves.update_curve_types(); + if (curves.curves_num() == 0) { + return curves_id; + } + MutableSpan positions = curves.positions_for_write(); OutputAttribute_Typed radius_attribute = component.attribute_try_get_for_output_only("radius", ATTR_DOMAIN_POINT);