Fix collection syncing when creating new collections from the outliner
[blender.git] / source / blender / blenkernel / intern / layer.c
index 9807c6e4f10a093b91e2c19a909cd000386ad78a..cb7b72bdabd659a6c1b34646e5aabc0770dd9701 100644 (file)
@@ -375,6 +375,7 @@ static void layer_collection_sync_flags(
 
 static void layer_collections_sync_flags(ListBase *layer_collections_dst, const ListBase *layer_collections_src)
 {
+       BLI_assert(BLI_listbase_count(layer_collections_dst) == BLI_listbase_count(layer_collections_src));
        LayerCollection *layer_collection_dst = (LayerCollection *)layer_collections_dst->first;
        const LayerCollection *layer_collection_src = (const LayerCollection *)layer_collections_src->first;
        while (layer_collection_dst != NULL) {