From d210ab90d4b7b0d2ce472493a697b1e868e36e78 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 31 Aug 2022 12:36:54 +0200 Subject: Fix crash in liboverride operations from the Outliner. Checks for 'invalid' selected IDs that need to be skipped were incomplete, and one was missing the actual return statement. --- source/blender/editors/space_outliner/outliner_tools.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index d6305c836ff..847b9e0963b 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -1274,7 +1274,7 @@ static void id_override_library_reset_fn(bContext *C, OutlinerLibOverrideData *data = reinterpret_cast(user_data); const bool do_hierarchy = data->do_hierarchy; - if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) { + if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root) || ID_IS_LINKED(id_root)) { CLOG_WARN(&LOG, "Could not reset library override of data block '%s'", id_root->name); return; } @@ -1302,7 +1302,7 @@ static void id_override_library_clear_single_fn(bContext *C, ViewLayer *view_layer = CTX_data_view_layer(C); ID *id = tselem->id; - if (!ID_IS_OVERRIDE_LIBRARY_REAL(id)) { + if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || ID_IS_LINKED(id)) { BKE_reportf(reports, RPT_WARNING, "Cannot clear embedded library override id '%s', only overrides of real " @@ -1350,8 +1350,9 @@ static void id_override_library_resync_fn(bContext *UNUSED(C), ID *id_root = tselem->id; OutlinerLibOverrideData *data = reinterpret_cast(user_data); - if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) { + if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root) || ID_IS_LINKED(id_root)) { CLOG_WARN(&LOG, "Could not resync library override of data block '%s'", id_root->name); + return; } if (id_root->override_library->hierarchy_root != nullptr) { @@ -1399,7 +1400,7 @@ static void id_override_library_delete_hierarchy_fn(bContext *UNUSED(C), BLI_assert(TSE_IS_REAL_ID(tselem)); ID *id_root = tselem->id; - if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root)) { + if (!ID_IS_OVERRIDE_LIBRARY_REAL(id_root) || ID_IS_LINKED(id_root)) { CLOG_WARN(&LOG, "Could not delete library override of data block '%s'", id_root->name); return; } -- cgit v1.2.3