From 7a71f58af3b5f70e8982d827d1fef7e8bc4e4ec8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 14 Sep 2012 06:17:14 +0000 Subject: fixes for NULL checks, remove some redundant checks and add some in that have been removed by accident as code has been updated. --- source/blender/editors/physics/particle_object.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/physics/particle_object.c') 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 -- cgit v1.2.3