Skip to content

Commit 8a335b3

Browse files
committed
runtime: if Runtime::GetRuntime() fails, we want to throw exception to Java with napi_env being NULL.
1 parent 83bf0e4 commit 8a335b3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

test-app/runtime/src/main/cpp/runtime/com_tns_Runtime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ Runtime* TryGetRuntime(int runtimeId) {
6464
try {
6565
runtime = Runtime::GetRuntime(runtimeId);
6666
} catch (NativeScriptException& e) {
67-
e.ReThrowToJava(runtime->GetNapiEnv());
67+
e.ReThrowToJava(nullptr);
6868
} catch (std::exception e) {
6969
stringstream ss;
7070
ss << "Error: c++ exception: " << e.what() << endl;
7171
NativeScriptException nsEx(ss.str());
72-
nsEx.ReThrowToJava(runtime->GetNapiEnv());
72+
nsEx.ReThrowToJava(nullptr);
7373
} catch (...) {
7474
NativeScriptException nsEx(std::string("Error: c++ exception!"));
75-
nsEx.ReThrowToJava(runtime->GetNapiEnv());
75+
nsEx.ReThrowToJava(nullptr);
7676
}
7777
return runtime;
7878
}

0 commit comments

Comments
 (0)