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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-03-25 10:41:30 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-03-25 16:03:20 +0300
commit543becac36e08cdba5ba6230fe77138c0a2124f6 (patch)
tree0527032a7ee701c5fe40fa25e078f1cc0aa0e154 /source/blender/editors/geometry
parent0083a7615eb4928f470c6400bfc52af8154d4ef0 (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
Diffstat (limited to 'source/blender/editors/geometry')
-rw-r--r--source/blender/editors/geometry/geometry_attributes.c6
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)