Animation: fix assertion failure on unsetting active keyframe

Avoid NULL pointer dereference when checking keyframe selection state in
`BLI_assert()` call.
This commit is contained in:
Sybren A. Stüvel 2020-10-12 17:27:27 +02:00
parent 058a69974a
commit 6f0b082378
1 changed files with 1 additions and 1 deletions

View File

@ -840,7 +840,7 @@ bool BKE_fcurve_calc_range(
void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt)
{
/* The active keyframe should always be selected. */
BLI_assert(active_bezt->f2 & SELECT);
BLI_assert(active_bezt == NULL || (active_bezt->f2 & SELECT));
fcu->active_keyframe_index = (active_bezt == NULL) ? FCURVE_ACTIVE_KEYFRAME_NONE :
active_bezt - fcu->bezt;
}