[Bf-blender-cvs] [421c0b45e50] master: Fix (studio-reported) crash in collection management code.

Bastien Montagne noreply at git.blender.org
Mon May 31 10:25:54 CEST 2021


Commit: 421c0b45e5015547e98112016bc550da5296e334
Author: Bastien Montagne
Date:   Mon May 31 10:20:23 2021 +0200
Branches: master
https://developer.blender.org/rB421c0b45e5015547e98112016bc550da5296e334

Fix (studio-reported) crash in collection management code.

Code checking for potential collection loop dependencies can be called
in cases where we cannot guarantee that there is no NULL pointers, so we
need to check those. Was already done for objects.

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

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

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

diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index d8fbdf26d93..be827cd338d 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1423,7 +1423,8 @@ static bool collection_instance_find_recursive(Collection *collection,
   }
 
   LISTBASE_FOREACH (CollectionChild *, collection_child, &collection->children) {
-    if (collection_instance_find_recursive(collection_child->collection, instance_collection)) {
+    if (collection_child->collection != NULL &&
+        collection_instance_find_recursive(collection_child->collection, instance_collection)) {
       return true;
     }
   }



More information about the Bf-blender-cvs mailing list