From 3e0a6ea2cf2056a2fcc8b67b92dbd128f87ac9d9 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Fri, 20 Nov 2015 14:52:53 +0100 Subject: [PATCH] Fixed: Return NULL when out of bounce --- Objective-J/Runtime.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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)