diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-14 10:17:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-14 10:17:14 +0400 |
commit | 7a71f58af3b5f70e8982d827d1fef7e8bc4e4ec8 (patch) | |
tree | ae5ee3e8c3a1d029e54531bbfd5ac8db42d9f7d9 /source/blender/editors/physics | |
parent | 3957efdd38d0d5136f8d106de3a79e07b7b0b15f (diff) |
fixes for NULL checks, remove some redundant checks and add some in that have been removed by accident as code has been updated.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index b57500df719..a17d84af128 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -98,12 +98,14 @@ void OBJECT_OT_particle_system_add(wmOperatorType *ot) static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op)) { - Object *ob= ED_object_context(C); + Object *ob = ED_object_context(C); Scene *scene = CTX_data_scene(C); - int mode_orig = ob->mode; + int mode_orig; + if (!scene || !ob) return OPERATOR_CANCELLED; + mode_orig = ob->mode; object_remove_particle_system(scene, ob); /* possible this isn't the active object |