Fix T81214: Crash on Action constraint without action

A `NULL` pointer check was missing.
This commit is contained in:
Sybren A. Stüvel 2020-09-28 11:23:34 +02:00
parent 1f5331ee87
commit f808f2a495
Notes: blender-bot 2023-02-14 07:25:51 +01:00
Referenced by issue #81214, Crash on Action constraint without action
1 changed files with 5 additions and 0 deletions

View File

@ -239,6 +239,11 @@ bool BKE_animdata_action_ensure_idroot(const ID *owner, bAction *action)
{
const int idcode = GS(owner->name);
if (action == NULL) {
/* A NULL action is usable by any ID type. */
return true;
}
if (action->idroot == 0) {
/* First time this Action is assigned, lock it to this ID type. */
action->idroot = idcode;