Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion c/src/main/cpp/jni_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ void TryCopyLastError(JNIEnv* env, InnerPrivateData* private_data) {
return;
}

jsize error_bytes_len = env->GetArrayLength(arr);
char* error_str = reinterpret_cast<char*>(error_bytes);
private_data->last_error_ = std::string(error_str, std::strlen(error_str));
private_data->last_error_ = std::string(error_str, error_bytes_len);

env->ReleaseByteArrayElements(arr, error_bytes, JNI_ABORT);
}
Expand Down
Loading