summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jni_internal.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index e6c2a227fd..8c0c1ec22c 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -2114,8 +2114,8 @@ class JNI {
if (capacity < 0) {
JniAbortF("NewDirectByteBuffer", "negative buffer capacity: %d", capacity);
}
- if (address == NULL) {
- JniAbortF("NewDirectByteBuffer", "NULL pointer passed for buffer address");
+ if (address == NULL && capacity != 0) {
+ JniAbortF("NewDirectByteBuffer", "non-zero capacity for NULL pointer: %d", capacity);
}
// At the moment, the Java side is limited to 32 bits.