diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2020-01-15 19:46:50 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2020-01-15 19:48:45 +0300 |
commit | ca49643f3c254a0bdb75f9972880c62bf7f44c3e (patch) | |
tree | acb83fd577eacbf0673992957366e8c6daf0f70d /source/blender/blenloader/intern | |
parent | c27acbcfb79f7194d97564ce57b25dd62933f589 (diff) |
Fix T70965: Undo crash with specific file
Not sure how the WorkSpaceLayout.screen pointer could end up being NULL,
but apparently that happens, or at least happened with older files.
Rather than just adding NULL-checks, prefer not keeping around those
invalid layouts at all.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 086f1db117d..fbe270dd060 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3377,6 +3377,11 @@ static void lib_link_workspaces(FileData *fd, Main *bmain) } } } + else { + /* If we're reading a layout without screen stored, it's useless and we shouldn't keep it + * around. */ + BKE_workspace_layout_remove(bmain, workspace, layout); + } } id->tag &= ~LIB_TAG_NEED_LINK; |