From f7effe8597eab6aed07d0e166bbebb2ecc522c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 26 Sep 2024 17:29:17 +0200 Subject: [PATCH] Anim: fix null pointer dereference when pushing down an Action Pull Request: https://projects.blender.org/blender/blender/pulls/128199 --- source/blender/editors/space_nla/nla_tracks.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_nla/nla_tracks.cc b/source/blender/editors/space_nla/nla_tracks.cc index 40f75e6cba6..bf4c6ec388a 100644 --- a/source/blender/editors/space_nla/nla_tracks.cc +++ b/source/blender/editors/space_nla/nla_tracks.cc @@ -432,7 +432,9 @@ static int nlatracks_pushdown_exec(bContext *C, wmOperator *op) "Cannot push down actions while tweaking a strip's action, exit tweak mode first"); return OPERATOR_CANCELLED; } - if (adt->action == nullptr) { + + bAction *action_to_push_down = adt->action; + if (!action_to_push_down) { BKE_report(op->reports, RPT_WARNING, "No active action to push down"); return OPERATOR_CANCELLED; } @@ -445,7 +447,7 @@ static int nlatracks_pushdown_exec(bContext *C, wmOperator *op) /* The action needs updating too, as FCurve modifiers are to be reevaluated. They won't extend * beyond the NLA strip after pushing down to the NLA. */ - DEG_id_tag_update_ex(bmain, &adt->action->id, ID_RECALC_ANIMATION); + DEG_id_tag_update_ex(bmain, &action_to_push_down->id, ID_RECALC_ANIMATION); /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, nullptr);