diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-16 18:03:37 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-16 18:07:04 +0300 |
commit | 365271a5886e1678b41e636581616446766b5f85 (patch) | |
tree | edb51854ff3123b29aca8d025bd7e99b4f56756b /source/blender/blenloader | |
parent | 0696eaa3e84e9394518e9bc86217291aa58dcf13 (diff) |
Fix tests after adding collection color tagging
Fix a segfault caused by assuming all scenes have a master collection
when applying versioning to old files.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 8a5f77fac1d..064b6139fde 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -658,7 +658,11 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) collection->color_tag = COLLECTION_COLOR_NONE; } LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { - scene->master_collection->color_tag = COLLECTION_COLOR_NONE; + /* Old files do not have a master collection, but it will be created by + * `BKE_collection_master_add()`. */ + if (scene->master_collection) { + scene->master_collection->color_tag = COLLECTION_COLOR_NONE; + } } } |