From dcadb3301ef0d09fa5969f2109eeb73e3c8a8d0a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 20 Aug 2024 18:19:39 +0200 Subject: [PATCH] 'Fix' crash in append code in invalid data cases (linked data using local data). Issue found here at the studio in some production files using dirty hacks. Ideally we could fully forbid such assignement in BPY/RNA API too, but there is no 'proper' way to achieve this without this dirty hack currenlty. So instead, check for this case and print a nice error about it for now. --- source/blender/blenkernel/intern/blendfile_link_append.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/blenkernel/intern/blendfile_link_append.cc b/source/blender/blenkernel/intern/blendfile_link_append.cc index 45b740ced86..487ea041dd9 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.cc +++ b/source/blender/blenkernel/intern/blendfile_link_append.cc @@ -978,6 +978,13 @@ static bool foreach_libblock_link_append_common_processing( if (id == nullptr) { return false; } + if (!ID_IS_LINKED(id)) { + CLOG_ERROR( + &LOG, + "Local ID '%s' found as part of the linked data hierarchy, this should never happen", + id->name); + return false; + } if (!BKE_idtype_idcode_is_linkable(GS(id->name))) { /* While we do not want to add non-linkable ID (shape keys...) to the list of linked items,