We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3628656 commit 3100581Copy full SHA for 3100581
cpp/core/jni/JniCommon.h
@@ -502,9 +502,12 @@ class JavaRssClient : public RssClient {
502
return;
503
}
504
env->DeleteGlobalRef(javaRssShuffleWriter_);
505
- jbyte* byteArray = env->GetByteArrayElements(array_, NULL);
506
- env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
507
- env->DeleteGlobalRef(array_);
+ // array_ may be nullptr when failed to allocate new byte array in pushPartitionData
+ if (array_ != nullptr) {
+ jbyte* byteArray = env->GetByteArrayElements(array_, NULL);
508
+ env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
509
+ env->DeleteGlobalRef(array_);
510
+ }
511
512
513
int32_t pushPartitionData(int32_t partitionId, const char* bytes, int64_t size) override {
0 commit comments