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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-09-26 10:21:27 +0300
committerJeroen Bakker <jeroen@blender.org>2020-10-07 10:50:01 +0300
commitb72df3a4a4ad2e88eac27dc72fad6942555da2ee (patch)
treef9bf9f61ff783738420ca01457ad20827509fbe1 /source
parent7ac5695b2983332aab9ce15810fabd6e69ad0878 (diff)
Fix T81168: 2.8x Crash when loading 2.79 file.
Object in the 2.7x file is on no layer at all, while this is not really expected nor considered valid, better to cope with the case gracefully than crash. To be backported to 2.90 and 2.83.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index d7a5d54b3f6..f141050f6b7 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1241,7 +1241,12 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
break;
}
}
- BLI_assert(collection_hidden != NULL);
+ if (collection_hidden == NULL) {
+ /* This should never happen (objects are always supposed to be instantiated in a
+ * scene), but it does sometimes, see e.g. T81168.
+ * Just put them in first hidden collection in those cases. */
+ collection_hidden = &hidden_collection_array[0];
+ }
if (*collection_hidden == NULL) {
char name[MAX_ID_NAME];