diff options
author | Pratik Borhade <PratikPB2123> | 2022-07-07 16:23:41 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-07-07 16:24:17 +0300 |
commit | 3063d90cfc057b4e1f269fd0723abbc0f2ae12f0 (patch) | |
tree | 50b1b0355c0f68ce4e7333f800905949286ca7ff /source/blender/editors/object/object_vgroup.c | |
parent | eb7218de8dba2a977fdcf8f2e75b16fcd8fc044a (diff) |
Fix T99453: Regression: Crash on calling menu search
Fix T99453.
Crash due to null pointer access.
So wrap the function call in simple `if` check
Reviewed By: sybren
Maniphest Tasks: T99453
Differential Revision: https://developer.blender.org/D15370
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 158bc28662a..17b7fe7fe5e 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -732,8 +732,10 @@ const EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(const bContext * } /* Set `Deform Bone` as default selection if armature is present. */ - RNA_def_property_enum_default( - prop, BKE_modifiers_is_deformed_by_armature(ob) ? WT_VGROUP_BONE_DEFORM : WT_VGROUP_ALL); + if (ob) { + RNA_def_property_enum_default( + prop, BKE_modifiers_is_deformed_by_armature(ob) ? WT_VGROUP_BONE_DEFORM : WT_VGROUP_ALL); + } RNA_enum_item_end(&item, &totitem); *r_free = true; |