Attributes: Add null check in color attribute duplicate operator

It's potentially possible that the attribute duplication could fail,
for whetever reason. There is no great reason not to be safe in
this high-level code.
This commit is contained in:
2022-06-14 16:27:06 +02:00
parent 58a67e6fb6
commit 0f06de8072

View File

@@ -525,6 +525,9 @@ static int geometry_color_attribute_duplicate_exec(bContext *C, wmOperator *op)
}
CustomDataLayer *newLayer = BKE_id_attribute_duplicate(id, layer->name, op->reports);
if (newLayer == nullptr) {
return OPERATOR_CANCELLED;
}
BKE_id_attributes_active_color_set(id, newLayer);