Fix crashes with invisible Outliners on fullscreen or window closing

I didn't actually confirm this is caused by invisible Outliners. But I'm pretty
sure the error happens with Outliners that aren't initialized (so were open in
an area before, but another editor is active there currently).
In that case, the runtime data may not be set yet and that is fine.

Fixes T83420.
This commit is contained in:
Julian Eisel 2020-12-05 14:41:20 +01:00
parent 237f9da4a0
commit 52a6c4f34d
Notes: blender-bot 2023-02-14 11:25:11 +01:00
Referenced by issue #83420, Closing Preferences Panel crashes Blender
1 changed files with 4 additions and 1 deletions

View File

@ -414,7 +414,10 @@ static void outliner_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_i
changed = true;
}
}
if (space_outliner->runtime->treehash && changed) {
/* Note that the Outliner may not be the active editor of the area, and hence not initialized.
* So runtime data might not have been created yet. */
if (space_outliner->runtime && space_outliner->runtime->treehash && changed) {
/* rebuild hash table, because it depends on ids too */
/* postpone a full rebuild because this can be called many times on-free */
space_outliner->storeflag |= SO_TREESTORE_REBUILD;