diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-03-25 10:41:30 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-03-25 16:03:20 +0300 |
commit | 543becac36e08cdba5ba6230fe77138c0a2124f6 (patch) | |
tree | 0527032a7ee701c5fe40fa25e078f1cc0aa0e154 | |
parent | 0083a7615eb4928f470c6400bfc52af8154d4ef0 (diff) |
Fix T86921: Executing "Operator Cheat Sheet" Crashes Blender
This was only happening without an active object.
The "Operator Cheat Sheet" operator collects info about all operators,
and as part of that executes the callbacks to create dynamic enums. The
callback to enumerate the geometry operators (introduced in
rB370d6e50252b) attribute domains depends on a context object. If this
isn't available, we just have to return `DummyRNA_NULL_items`.
Maniphest Tasks: T86921
Differential Revision: https://developer.blender.org/D10814
-rw-r--r-- | source/blender/editors/geometry/geometry_attributes.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/geometry/geometry_attributes.c b/source/blender/editors/geometry/geometry_attributes.c index 2807e7c4392..12f6bb90677 100644 --- a/source/blender/editors/geometry/geometry_attributes.c +++ b/source/blender/editors/geometry/geometry_attributes.c @@ -53,7 +53,11 @@ static const EnumPropertyItem *geometry_attribute_domain_itemf(bContext *C, bool *r_free) { Object *ob = ED_object_context(C); - return rna_enum_attribute_domain_itemf(ob->data, r_free); + if (ob != NULL) { + return rna_enum_attribute_domain_itemf(ob->data, r_free); + } + + return DummyRNA_NULL_items; } static int geometry_attribute_add_exec(bContext *C, wmOperator *op) |