Fix #129589: Crash when pushing down NLA track

The issue is that the action line may be there, but containing no action,
`bAnimListElem->data` pointer is a nullptr.

caused by b952782a44
In this refactor the function call was changed from
`BKE_action_frame_range_get` which could handle
the case of a nullptr passed to it.

Pull Request: https://projects.blender.org/blender/blender/pulls/129648
This commit is contained in:
Christoph Lendenfeld 2024-11-05 09:38:51 +01:00 committed by Christoph Lendenfeld
parent ca1c06e8c4
commit 103f494062

View File

@ -883,6 +883,11 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
break;
}
case NLASTRIP_EXTEND_HOLD_FORWARD: {
if (ale->data == nullptr) {
/* This can happen if the object itself has no action attached anymore (e.g. after
* using "push down"). */
break;
}
const animrig::Action &action = static_cast<bAction *>(ale->data)->wrap();
float2 frame_range = action.get_frame_range();
BKE_nla_clip_length_ensure_nonzero(&frame_range[0], &frame_range[1]);