From d216a0b505735da432448c438982b5cac1cba9ee Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 10 Apr 2020 17:28:26 +0200 Subject: 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. --- source/blender/editors/space_outliner/outliner_edit.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- cgit v1.2.3