From 543becac36e08cdba5ba6230fe77138c0a2124f6 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 25 Mar 2021 08:41:30 +0100 Subject: 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 --- source/blender/editors/geometry/geometry_attributes.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/geometry') 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) -- cgit v1.2.3