malinjawi commented on code in PR #12592:
URL: https://github.com/apache/gluten/pull/12592#discussion_r4339489611
##########
cpp/velox/jni/JniHashTable.cc:
##########
@@ -45,14 +45,20 @@ void JniHashTableContext::finalize(JNIEnv* env) {
}
}
-jlong JniHashTableContext::callJavaGet(const std::string& id) const {
+std::optional<jlong> JniHashTableContext::callJavaGet(const std::string& id)
const {
+ if (vm_ == nullptr) {
+ return std::nullopt;
+ }
+
JNIEnv* env;
if (vm_->GetEnv(reinterpret_cast<void**>(&env), jniVersion) != JNI_OK) {
throw gluten::GlutenException("JNIEnv was not attached to current thread");
}
const jstring s = env->NewStringUTF(id.c_str());
Review Comment:
Done in e51f37733, added `checkException(env)` right after `NewStringUTF`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]