code cleanup: remove paranoid NULL checks (these cases would crash earlier of the vars were in fact NULL)

This commit is contained in:
2012-09-15 06:29:32 +00:00
parent aa364bb366
commit 77ed2d8ca9
8 changed files with 31 additions and 30 deletions

View File

@@ -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;
}