Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-15 10:29:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-15 10:29:32 +0400
commit77ed2d8ca9af8bb646ceb56f47e7a9e21d1eaaee (patch)
tree9f7bf0a150b958f0a56ed9eae00fbc516618a6ac /source/blender/editors/object/object_hook.c
parentaa364bb366d8c0d6566ffacd59d881a8bab8657b (diff)
code cleanup: remove paranoid NULL checks (these cases would crash earlier of the vars were in fact NULL)
Diffstat (limited to 'source/blender/editors/object/object_hook.c')
-rw-r--r--source/blender/editors/object/object_hook.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 7c8386d55dc..a6afe6b2d04 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -585,13 +585,11 @@ void OBJECT_OT_hook_add_newobj(wmOperatorType *ot)
static int object_hook_remove_exec(bContext *C, wmOperator *op)
{
int num = RNA_enum_get(op->ptr, "modifier");
- Object *ob = NULL;
+ Object *ob = CTX_data_edit_object(C);
HookModifierData *hmd = NULL;
- ob = CTX_data_edit_object(C);
hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
-
- if (!ob || !hmd) {
+ if (!hmd) {
BKE_report(op->reports, RPT_ERROR, "Couldn't find hook modifier");
return OPERATOR_CANCELLED;
}