Fix #133362: crash when autokeying object with motion path but no action

When moving an object with a motion path and animdata but no assigned
action, and with certain auto-key settings enabled, Blender would crash.

The cause was code that tried to access an action's fcurves without
proper guarding: the guard checked whether an object had animdata, but
not whether it had an action assigned or not, and would happily try to
access that non-existent action's fcurves.

This fixes the crash by also checking if an action is assigned.

Pull Request: https://projects.blender.org/blender/blender/pulls/133552
This commit is contained in:
Nathan Vegdahl
2025-01-27 09:52:32 +01:00
committed by Philipp Oeser
parent 92dac01804
commit c1967d0fb6
@@ -459,8 +459,8 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph,
mpt->keylist = ED_keylist_create();
ListBase *fcurve_list = nullptr;
if (adt) {
/* get pointer to animviz settings for each target */
if (adt && adt->action) {
/* Get pointer to animviz settings for each target. */
bAnimVizSettings *avs = animviz_target_settings_get(mpt);
/* it is assumed that keyframes for bones are all grouped in a single group