Fix (unreported) crash in liboverride code on rare cases.

When dealing with 'embedded' IDs (and the like, e.g. shape keys),
liboverride code could fail in case the reference linked data (e.g. a
mesh) would not have a shapekey anymore, while the override mesh would
still have one.

Found while investigating another issue in Heist production file
`Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`,
r1230.
This commit is contained in:
Bastien Montagne 2022-07-11 19:04:24 +02:00
parent 8ca09e6c5e
commit 995c904d00
1 changed files with 5 additions and 0 deletions

View File

@ -1771,6 +1771,11 @@ static bool lib_override_library_resync(Main *bmain,
break;
}
}
if (reference_id == nullptr) {
/* Can happen e.g. when there is a local override of a shapekey, but the matching linked
* obdata (mesh etc.) does not have any shapekey anymore. */
continue;
}
BLI_assert(GS(reference_id->name) == GS(id->name));
if (!BLI_ghash_haskey(linkedref_to_old_override, reference_id)) {