diff options
author | Julian Eisel <julian@blender.org> | 2020-04-10 18:28:26 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-04-10 18:30:43 +0300 |
commit | d216a0b505735da432448c438982b5cac1cba9ee (patch) | |
tree | 18a9c8aef697cb93058e14bcd51ffdd40a268904 /source/blender/editors | |
parent | 475d7d073add3d1f49867d1ab5c0a1b4857adab8 (diff) |
Fix T75489: Crash on deleting current workspace from the outliner
It should not be possible to delete the current workspace from the
outliner. Show an error message instead.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 60e6b423720..3ae100b6209 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -54,6 +54,7 @@ #include "BKE_outliner_treehash.h" #include "BKE_report.h" #include "BKE_scene.h" +#include "BKE_workspace.h" #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" @@ -473,6 +474,14 @@ static void id_delete(bContext *C, ReportList *reports, TreeElement *te, TreeSto id->name); return; } + else if (te->idcode == ID_WS) { + BKE_workspace_id_tag_all_visible(bmain, LIB_TAG_DOIT); + if (id->tag & LIB_TAG_DOIT) { + BKE_reportf( + reports, RPT_WARNING, "Cannot delete currently visible workspace id '%s'", id->name); + return; + } + } BKE_id_delete(bmain, id); |