summaryrefslogtreecommitdiff
path: root/runtime/check_jni.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/check_jni.cc')
-rw-r--r--runtime/check_jni.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc
index a84e18acc8..09c48b1220 100644
--- a/runtime/check_jni.cc
+++ b/runtime/check_jni.cc
@@ -1754,8 +1754,8 @@ PRIMITIVE_ARRAY_FUNCTIONS(jdouble, Double, 'D');
if (address == NULL) {
JniAbortF(__FUNCTION__, "non-nullable address is NULL");
}
- if (capacity <= 0) {
- JniAbortF(__FUNCTION__, "capacity must be greater than 0: %lld", capacity);
+ if (capacity < 0) {
+ JniAbortF(__FUNCTION__, "capacity must be non negative: %lld", capacity);
}
return CHECK_JNI_EXIT("L", baseEnv(env)->NewDirectByteBuffer(env, address, capacity));
}