[Bf-blender-cvs] [e39dc48bd51] blender2.8: Fix crash when duplicating object

Sergey Sharybin noreply at git.blender.org
Fri Jul 28 13:02:51 CEST 2017


Commit: e39dc48bd51c6ba5ba72f2ebdf66a91ac6630170
Author: Sergey Sharybin
Date:   Fri Jul 28 13:02:20 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBe39dc48bd51c6ba5ba72f2ebdf66a91ac6630170

Fix crash when duplicating object

This fixes null pointer check fiasco.

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

M	source/blender/blenkernel/intern/collection.c

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

diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 91fa01a9e0b..2b69c176c39 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -260,10 +260,10 @@ void BKE_collection_object_add_from(Scene *scene, Object *ob_src, Object *ob_dst
 
 	for (SceneLayer *sl = scene->render_layers.first; sl; sl = sl->next) {
 		Base *base_src = BKE_scene_layer_base_find(sl, ob_src);
-		if (base_src->collection_properties == NULL) {
-			continue;
-		}
 		if (base_src != NULL) {
+			if (base_src->collection_properties == NULL) {
+				continue;
+			}
 			Base *base_dst = BKE_scene_layer_base_find(sl, ob_dst);
 			IDP_MergeGroup(base_dst->collection_properties, base_src->collection_properties, true);
 		}




More information about the Bf-blender-cvs mailing list