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:
authorGaia Clary <gaia.clary@machinimatrix.org>2020-12-20 20:48:07 +0300
committerGaia Clary <gaia.clary@machinimatrix.org>2020-12-20 20:48:40 +0300
commitd283a093d6643fc63264d95bed46af0646788277 (patch)
tree127c86e24247a61903260428bf4277de2d2b4604 /source/blender/editors/object/object_vgroup.c
parent478ba532700fa4c2bbcccfd821d1386653729fb5 (diff)
fix T83880: Added check for valid context object to avoid null pointer exception when no object in scene
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r--source/blender/editors/object/object_vgroup.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 23f1718cb2e..fc4969019b5 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -736,17 +736,19 @@ const EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(const bContext *
RNA_enum_items_add_value(&item, &totitem, WT_vertex_group_select_item, WT_VGROUP_ACTIVE);
}
- if (BKE_object_pose_armature_get(ob)) {
- if (selection_mask & (1 << WT_VGROUP_BONE_SELECT)) {
- RNA_enum_items_add_value(
- &item, &totitem, WT_vertex_group_select_item, WT_VGROUP_BONE_SELECT);
+ if (ob) {
+ if (BKE_object_pose_armature_get(ob)) {
+ if (selection_mask & (1 << WT_VGROUP_BONE_SELECT)) {
+ RNA_enum_items_add_value(
+ &item, &totitem, WT_vertex_group_select_item, WT_VGROUP_BONE_SELECT);
+ }
}
- }
- if (BKE_modifiers_is_deformed_by_armature(ob)) {
- if (selection_mask & (1 << WT_VGROUP_BONE_DEFORM)) {
- RNA_enum_items_add_value(
- &item, &totitem, WT_vertex_group_select_item, WT_VGROUP_BONE_DEFORM);
+ if (BKE_modifiers_is_deformed_by_armature(ob)) {
+ if (selection_mask & (1 << WT_VGROUP_BONE_DEFORM)) {
+ RNA_enum_items_add_value(
+ &item, &totitem, WT_vertex_group_select_item, WT_VGROUP_BONE_DEFORM);
+ }
}
}