Fix T60204: Crash when opening a File
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 25 Jan 2019 14:18:32 +0000 (15:18 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 25 Jan 2019 14:20:30 +0000 (15:20 +0100)
Missing code from 3d083f37. Need to ensure that ID properties
are properly allocated and restored on read.

source/blender/blenloader/intern/readfile.c

index 3dfb262414b585cc391a291bc3abecc886db43f7..71addb526becf58e80602660ce7bd85e37eaf30f 100644 (file)
@@ -6501,9 +6501,9 @@ static void direct_link_scene(FileData *fd, Scene *sce)
 
        if (sce->master_collection) {
                sce->master_collection = newdataadr(fd, sce->master_collection);
-               direct_link_collection(fd, sce->master_collection);
                /* Needed because this is an ID outside of Main. */
-               sce->master_collection->id.py_instance = NULL;
+               direct_link_id(fd, &sce->master_collection->id);
+               direct_link_collection(fd, sce->master_collection);
        }
 
        /* insert into global old-new map for reading without UI (link_global accesses it again) */