[Bf-blender-cvs] [543becac36e] master: Fix T86921: Executing "Operator Cheat Sheet" Crashes Blender

Philipp Oeser noreply at git.blender.org
Thu Mar 25 14:05:39 CET 2021


Commit: 543becac36e08cdba5ba6230fe77138c0a2124f6
Author: Philipp Oeser
Date:   Thu Mar 25 08:41:30 2021 +0100
Branches: master
https://developer.blender.org/rB543becac36e08cdba5ba6230fe77138c0a2124f6

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

===================================================================

M	source/blender/editors/geometry/geometry_attributes.c

===================================================================

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)



More information about the Bf-blender-cvs mailing list