diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-05 09:05:24 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-05 09:05:24 +0300 |
commit | ba6d50c3d39575d8631dbb4e91cff74838e68590 (patch) | |
tree | 106c6ddfa071bcf5f70433e9e94e406cd3c668a4 /source/blender | |
parent | f7a24a25bac02f7e74bd01451046a2ed0f89bb20 (diff) |
Bugfix #20975: Deleting a constraint causes segfault
Missing null checks in API functions.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index dd4f518037f..7a29011a391 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3878,11 +3878,13 @@ void constraints_set_active (ListBase *list, bConstraint *con) { bConstraint *c; - for (c= list->first; c; c= c->next) { - if (c == con) - c->flag |= CONSTRAINT_ACTIVE; - else - c->flag &= ~CONSTRAINT_ACTIVE; + if (list) { + for (c= list->first; c; c= c->next) { + if (c == con) + c->flag |= CONSTRAINT_ACTIVE; + else + c->flag &= ~CONSTRAINT_ACTIVE; + } } } |