diff --git a/Objective-J/Runtime.js b/Objective-J/Runtime.js index 9188017c2..3b816d4ca 100644 --- a/Objective-J/Runtime.js +++ b/Objective-J/Runtime.js @@ -1031,13 +1031,29 @@ GLOBAL(method_getTypes) = function(/*Method*/ aMethod) GLOBAL(method_copyReturnType) = function(/*Method*/ aMethod) { var types = aMethod.method_types; - return types ? types[0] : NULL; + + if (types) + { + var argType = types[0]; + + return argType != NULL ? argType : NULL; + } + else + return NULL; } GLOBAL(method_copyArgumentType) = function(/*Method*/ aMethod, /*unsigned int*/ index) { var types = aMethod.method_types; - return types ? types[index + 1] : NULL; + + if (types) + { + var argType = types[index + 1]; + + return argType != NULL ? argType : NULL; + } + else + return NULL; } GLOBAL(method_getImplementation) = function(/*Method*/ aMethod)