Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-05-31 11:20:23 +0300
committerBastien Montagne <bastien@blender.org>2021-05-31 12:25:08 +0300
commit2161840d07ae0a934a734ac6198aa7e5cc4b6fcf (patch)
tree7d737513f38d741166fcde11bfc327652b307fb6
parent632bfee0a5ea92d213b5c9d010483c16f0baa636 (diff)
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. NOTE: doubled-checked by @jbakker, thanks.
-rw-r--r--source/blender/blenkernel/intern/collection.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 3170c3aa65c..2813f535eb5 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1425,7 +1425,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;
}
}