Skip to content

Commit 113f130

Browse files
author
Mihail Slavchev
committed
add check for JavaScriptImplementation annotation in order to prevent unnecessary exception
1 parent 323eaab commit 113f130

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

build-artifacts/project-template-gradle/src/main/java/com/tns/RuntimeHelper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ public static Runtime initRuntime(Application app)
149149

150150
try {
151151
// put this call in a try/catch block because with the latest changes in the modules it is not granted that NativeScriptApplication is extended through JavaScript.
152-
Runtime.initInstance(app);
152+
JavaScriptImplementation jsImpl = app.getClass().getAnnotation(JavaScriptImplementation.class);
153+
if (jsImpl != null) {
154+
Runtime.initInstance(app);
155+
}
153156
}
154157
catch (Exception e) {
155158
if (logger.isEnabled()) {

0 commit comments

Comments
 (0)