[Bf-blender-cvs] [0295e14f5f2] master: Fix T81168: 2.8x Crash when loading 2.79 file.

Bastien Montagne noreply at git.blender.org
Sat Sep 26 09:23:20 CEST 2020


Commit: 0295e14f5f26dcaf557011b001e0ae314d3cc0ee
Author: Bastien Montagne
Date:   Sat Sep 26 09:21:27 2020 +0200
Branches: master
https://developer.blender.org/rB0295e14f5f26dcaf557011b001e0ae314d3cc0ee

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.

===================================================================

M	source/blender/blenloader/intern/versioning_280.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 213fbe0bde0..14a4643f760 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1242,7 +1242,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];



More information about the Bf-blender-cvs mailing list