diff options
author | Bastien Montagne <bastien@blender.org> | 2022-09-07 12:24:13 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-09-07 12:26:11 +0300 |
commit | 788952705c623d3748c6e46fa244b63bd9209717 (patch) | |
tree | 54c7bc2fea0c3c4533c10f72d9cfbae3c1857c66 /source/blender/blenkernel/intern/collection.c | |
parent | 46642507ae658a9a3704df70b5ca2028dc5a3593 (diff) |
IDManagement: Add some assert to ensure lib consistency in embedded IDs.
From re-checking related code, it seems that we already always ensure
consistency of the `lib` pointer between embedded IDs and their owners.
This commit only adds some asserts in ambedded ID read code to
double-check this.
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index cbab1a2de6a..2a544871716 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -236,6 +236,7 @@ void BKE_collection_blend_read_data(BlendDataReader *reader, Collection *collect /* Special case for this pointer, do not rely on regular `lib_link` process here. Avoids needs * for do_versioning, and ensures coherence of data in any case. */ BLI_assert((collection->id.flag & LIB_EMBEDDED_DATA) != 0 || owner_id == NULL); + BLI_assert(owner_id == NULL || owner_id->lib == collection->id.lib); if (owner_id != NULL && (collection->id.flag & LIB_EMBEDDED_DATA) == 0) { /* This is unfortunate, but currently a lot of existing files (including startup ones) have * missing `LIB_EMBEDDED_DATA` flag. |