diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-14 17:27:06 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-14 17:41:43 +0300 |
commit | 0f06de807249d24bf6ba7713d41a5b23f0336b97 (patch) | |
tree | 47347e617eccc76d9db3eee52d392cf492743c1a /source/blender | |
parent | 58a67e6fb6df527ed45c0a554efd387e770bdc42 (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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/geometry/geometry_attributes.cc | 3 |
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); |