Skip to content

Commit 9941eda

Browse files
committed
Add a concrete exception when the runtime cannot be found
1 parent d194bc9 commit 9941eda

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test-app/runtime/src/main/java/com/tns/Runtime.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,10 @@ public static Object callJSMethod(Object javaObject, String methodName, Class<?>
980980
runtime = getObjectRuntime(javaObject);
981981
}
982982

983+
if (runtime == null) {
984+
throw new NativeScriptException("Cannot find runtime for instance=" + ((javaObject == null) ? "null" : javaObject));
985+
}
986+
983987
return runtime.callJSMethodImpl(javaObject, methodName, retType, isConstructor, delay, args);
984988
}
985989

0 commit comments

Comments
 (0)