diff --git a/src/jnienv.cpp b/src/jnienv.cpp index f8a0ff3987..2a70b10855 100644 --- a/src/jnienv.cpp +++ b/src/jnienv.cpp @@ -3370,12 +3370,21 @@ PushLocalFrame(Thread* t, jint capacity) uint64_t popLocalFrame(Thread* t, uintptr_t* arguments) { - object result = *reinterpret_cast(arguments[0]); - PROTECT(t, result); + uint64_t r; + jobject presult = reinterpret_cast(arguments[0]); + if(presult != NULL) { + object result = *presult; + PROTECT(t, result); - t->m->processor->popLocalFrame(t); - - return reinterpret_cast(makeLocalReference(t, result)); + t->m->processor->popLocalFrame(t); + + r = reinterpret_cast(makeLocalReference(t, result)); + } else { + t->m->processor->popLocalFrame(t); + r = 0; + } + + return r; } jobject JNICALL