Fix potential crash opening 3.0 blend files in older versions.

Affects insertion of constraints in liboverrides. In some cases, when
opening newer post-3.0 .blend files, the source won't be found anymore,
override apply code then needs to fail properly instead of crashing.

Related to refactor from  rB33c5e7bcd5e5.
This commit is contained in:
Bastien Montagne 2021-11-22 14:27:02 +01:00
parent 14b8f6c25b
commit 95c82513ca
Notes: blender-bot 2023-02-14 01:21:16 +01:00
Referenced by issue #82160, LibOverrides - Refactor how diffing of RNA collections is handled, and extend diffing possibilities.
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 4 additions and 1 deletions

View File

@ -1545,7 +1545,10 @@ bool rna_Object_constraints_override_apply(Main *UNUSED(bmain),
}
con_src = con_src ? con_src->next : ob_src->constraints.first;
BLI_assert(con_src != NULL);
if (con_src == NULL) {
BLI_assert(con_src != NULL);
return false;
}
bConstraint *con_dst = BKE_constraint_duplicate_ex(con_src, 0, true);