Skip to content

Commit afe026a

Browse files
ptomatoedusperoni
authored andcommitted
fix: Use Isolate::TryGetCurrent()
Isolate::GetCurrent() is not supposed to return null; if there is no current isolate it's supposed to crash. Since we are checking for null right after, I think we want TryGetCurrent() here.
1 parent cd1d285 commit afe026a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ extern "C" JNIEXPORT jint Java_com_tns_Runtime_getPointerSize(JNIEnv* env, jobje
293293
}
294294

295295
extern "C" JNIEXPORT jint Java_com_tns_Runtime_getCurrentRuntimeId(JNIEnv* _env, jobject obj) {
296-
Isolate* isolate = Isolate::GetCurrent();
296+
Isolate* isolate = Isolate::TryGetCurrent();
297297
if (isolate == nullptr) {
298298
return -1;
299299
}

0 commit comments

Comments
 (0)