[Bf-blender-cvs] [ebde6e18526] blender-v2.93-release: Fix T88251: "Operator Cheat Sheet" Crash
Philipp Oeser
noreply at git.blender.org
Wed May 26 09:54:54 CEST 2021
Commit: ebde6e1852622d60d1cd574f1c7e2d6855ae90ba
Author: Philipp Oeser
Date: Tue May 25 17:46:17 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBebde6e1852622d60d1cd574f1c7e2d6855ae90ba
Fix T88251: "Operator Cheat Sheet" Crash
Caused by {rB919558854d62}.
Same fix as in {rBdc8a43c8755a} -- let RNA enum item callbacks check
for NULL context.
The NULL context is used to extract items for document generation.
Maniphest Tasks: T88251
Differential Revision: https://developer.blender.org/D11391
===================================================================
M source/blender/editors/geometry/geometry_attributes.c
M source/blender/editors/object/object_vgroup.c
===================================================================
diff --git a/source/blender/editors/geometry/geometry_attributes.c b/source/blender/editors/geometry/geometry_attributes.c
index 12f6bb90677..b2ecee90a57 100644
--- a/source/blender/editors/geometry/geometry_attributes.c
+++ b/source/blender/editors/geometry/geometry_attributes.c
@@ -52,12 +52,16 @@ static const EnumPropertyItem *geometry_attribute_domain_itemf(bContext *C,
PropertyRNA *UNUSED(prop),
bool *r_free)
{
+ if (C == NULL) {
+ return DummyRNA_NULL_items;
+ }
+
Object *ob = ED_object_context(C);
- if (ob != NULL) {
- return rna_enum_attribute_domain_itemf(ob->data, r_free);
+ if (ob == NULL) {
+ return DummyRNA_NULL_items;
}
- return DummyRNA_NULL_items;
+ return rna_enum_attribute_domain_itemf(ob->data, r_free);
}
static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 5f81f9afe4f..3f40d637188 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -3985,6 +3985,10 @@ static const EnumPropertyItem *vgroup_itemf(bContext *C,
PropertyRNA *UNUSED(prop),
bool *r_free)
{
+ if (C == NULL) {
+ return DummyRNA_NULL_items;
+ }
+
Object *ob = ED_object_context(C);
EnumPropertyItem tmp = {0, "", 0, "", ""};
EnumPropertyItem *item = NULL;
More information about the Bf-blender-cvs
mailing list