'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.
This commit is contained in:
Bastien Montagne
2024-08-20 18:19:39 +02:00
parent 41acd803e4
commit dcadb3301e

View File

@@ -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,