[Bf-blender-cvs] [5e13236] master: Correct NULL checks in recent weight-paint fix

Campbell Barton noreply at git.blender.org
Thu Jan 14 03:57:42 CET 2016


Commit: 5e1323640a0c8bff7a004971480d1bd9da484ee6
Author: Campbell Barton
Date:   Thu Jan 14 13:19:07 2016 +1100
Branches: master
https://developer.blender.org/rB5e1323640a0c8bff7a004971480d1bd9da484ee6

Correct NULL checks in recent weight-paint fix

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

M	source/blender/editors/sculpt_paint/paint_vertex.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index f51fe01..2056b3d 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;
+			}
 		}
 	}




More information about the Bf-blender-cvs mailing list