Check result handler is not null

If caller passes a null result handler to the proxy methods, we need
to check it when getting the result. Otherwise we try to invoke a method
on a null object

Change-Id: Ic2f456c36cb542b782b6a6d0d4d607ccf0987496
This commit is contained in:
Manuel Roman
2012-05-23 14:25:31 -07:00
parent 993f8a8c65
commit 9d98a08975

View File

@@ -784,7 +784,10 @@ generate_result_dispatcher_method(const method_type* method,
}
// Call the callback method
dispatchMethod->statements->Add(realCall);
IfStatement* ifst = new IfStatement;
ifst->expression = new Comparison(new FieldVariable(THIS_VALUE, "callback"), "!=", NULL_VALUE);
dispatchMethod->statements->Add(ifst);
ifst->statements->Add(realCall);
}
static void