Fix T70695: Scene crashes Blender on open.
Note that this commit fixes the crash itself, but actual issue is *how* that situation could happen (having insert override operation with local 'source' overriding data-block with an empty bone constraints stack...).
This commit is contained in:
parent
b57a89f062
commit
1e5e65fa9f
|
@ -648,7 +648,7 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain),
|
|||
|
||||
/* Remember that insertion operations are defined and stored in correct order, which means that
|
||||
* even if we insert several items in a row, we always insert first one, then second one, etc.
|
||||
* So we should always find 'anchor' constraint in both _src *and* _dst> */
|
||||
* So we should always find 'anchor' constraint in both _src *and* _dst */
|
||||
bConstraint *con_anchor = NULL;
|
||||
if (opop->subitem_local_name && opop->subitem_local_name[0]) {
|
||||
con_anchor = BLI_findstring(
|
||||
|
@ -669,7 +669,11 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain),
|
|||
}
|
||||
con_src = con_src ? con_src->next : pchan_src->constraints.first;
|
||||
|
||||
BLI_assert(con_src != NULL);
|
||||
if (con_src == NULL) {
|
||||
printf("%s: Could not find constraint to insert, doing nothing...\n", __func__);
|
||||
BLI_assert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
bConstraint *con_dst = BKE_constraint_duplicate_ex(con_src, 0, true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue