diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-04-16 16:10:27 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-04-16 16:11:56 +0300 |
commit | 6589d07c8faa6f2705530ed0dfc6ec30a77c72f2 (patch) | |
tree | 1d4f737e597eb028bc641064df45b02753dab955 /source/blender | |
parent | 0b691563eaff385d23c4199c85dc47a188420284 (diff) |
Action Editor: Preemptive fix for null-pointer dereference
A few weeks ago, I got a random crash while testing som edge cases
(IIRC, it was trying to assign an action with no active object),
which I haven't been able to reproduce since then. This commit though
adds some extra sanity checks here, as a user may try to assign an
action to an animdata block which did not have an action already.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ca3ea9bda81..8e3c4e5e877 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1225,7 +1225,9 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *s /* set action */ if (adt) { /* fix id-count of action we're replacing */ - id_us_min(&adt->action->id); + if (adt->action) { + id_us_min(&adt->action->id); + } /* assign new action, and adjust the usercounts accordingly */ adt->action = saction->action; |