diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-14 05:19:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-14 05:19:07 +0300 |
commit | 5e1323640a0c8bff7a004971480d1bd9da484ee6 (patch) | |
tree | 2dcc19bd51d9f613bd2f8624f34bfc6212ae5b18 /source | |
parent | 9f05fe00a024879379f9be085b58be2d816a7eb5 (diff) |
Correct NULL checks in recent weight-paint fix
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index f51fe013775..2056b3d6b7d 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2106,11 +2106,16 @@ static bool wpaint_ensure_data( return false; } - vgroup_index->active = ob->actdef - 1; + if (vgroup_index) { + vgroup_index->active = ob->actdef - 1; + } if (flag & WPAINT_ENSURE_MIRROR) { if (me->editflag & ME_EDIT_MIRROR_X) { - vgroup_index->mirror = wpaint_mirror_vgroup_ensure(ob, vgroup_index->active); + int mirror = wpaint_mirror_vgroup_ensure(ob, ob->actdef - 1); + if (vgroup_index) { + vgroup_index->mirror = mirror; + } } } |