Fix: Potential crash in curves attribute set operator
Similar to #134108. Caused by 0089a90625dd425803e8921a6573e17719b4bf9f..
This commit is contained in:
@@ -93,8 +93,8 @@ static int set_attribute_exec(bContext *C, wmOperator *op)
|
||||
Object *active_object = CTX_data_active_object(C);
|
||||
Curves &active_curves_id = *static_cast<Curves *>(active_object->data);
|
||||
|
||||
AttributeOwner owner = AttributeOwner::from_id(&active_curves_id.id);
|
||||
CustomDataLayer *active_attribute = BKE_attributes_active_get(owner);
|
||||
AttributeOwner active_owner = AttributeOwner::from_id(&active_curves_id.id);
|
||||
CustomDataLayer *active_attribute = BKE_attributes_active_get(active_owner);
|
||||
const eCustomDataType active_type = eCustomDataType(active_attribute->type);
|
||||
const CPPType &type = *bke::custom_data_type_to_cpp_type(active_type);
|
||||
|
||||
@@ -107,6 +107,7 @@ static int set_attribute_exec(bContext *C, wmOperator *op)
|
||||
|
||||
for (Curves *curves_id : get_unique_editable_curves(*C)) {
|
||||
bke::CurvesGeometry &curves = curves_id->geometry.wrap();
|
||||
AttributeOwner owner = AttributeOwner::from_id(&curves_id->id);
|
||||
CustomDataLayer *layer = BKE_attributes_active_get(owner);
|
||||
if (!layer) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user