[Bf-blender-cvs] [62189a5ab7d] blender2.8: Fix potential crash introduced by weightpaint engine when no active object

Dalai Felinto noreply at git.blender.org
Wed May 3 20:25:41 CEST 2017


Commit: 62189a5ab7d9465a33f1d4e7e6d4f30168ffae22
Author: Dalai Felinto
Date:   Wed May 3 20:10:54 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB62189a5ab7d9465a33f1d4e7e6d4f30168ffae22

Fix potential crash introduced by weightpaint engine when no active object

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

M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index a2c7458d395..3758f3d1278 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2538,7 +2538,12 @@ static void rna_LayerCollectionEngineSettings_weight_wire_update(bContext *C, Po
 {
 	Scene *scene = CTX_data_scene(C);
 	SceneLayer *sl = CTX_data_scene_layer(C);
-	BKE_mesh_batch_cache_dirty(sl->basact->object->data, BKE_MESH_BATCH_DIRTY_WEIGHT);
+	Object *ob = OBACT_NEW;
+
+	if (ob != NULL) {
+		BKE_mesh_batch_cache_dirty(ob, BKE_MESH_BATCH_DIRTY_WEIGHT);
+	}
+
 	/* TODO(sergey): Use proper flag for tagging here. */
 	DAG_id_tag_update(&scene->id, 0);
 }




More information about the Bf-blender-cvs mailing list