Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-06-14 17:27:06 +0300
committerHans Goudey <h.goudey@me.com>2022-06-14 17:41:43 +0300
commit0f06de807249d24bf6ba7713d41a5b23f0336b97 (patch)
tree47347e617eccc76d9db3eee52d392cf492743c1a
parent58a67e6fb6df527ed45c0a554efd387e770bdc42 (diff)
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.
-rw-r--r--source/blender/editors/geometry/geometry_attributes.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc
index 79639097fbe..e880e0db76c 100644
--- a/source/blender/editors/geometry/geometry_attributes.cc
+++ b/source/blender/editors/geometry/geometry_attributes.cc
@@ -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);