Skip to content

Commit 363f731

Browse files
Return immediately when new byte array can not be created
1 parent c88dfdd commit 363f731

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jni/net_sqlcipher_CursorWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace sqlcipher {
172172
uint8_t type = field.type;
173173
if (type == FIELD_TYPE_BLOB || type == FIELD_TYPE_STRING) {
174174
jbyteArray byteArray = env->NewByteArray(field.data.buffer.size);
175-
LOG_ASSERT(byteArray, "Native could not create new byte[]");
175+
if(byteArray == NULL) return NULL;
176176
env->SetByteArrayRegion(byteArray, 0, field.data.buffer.size,
177177
(const jbyte*)window->offsetToPtr(field.data.buffer.offset));
178178
return byteArray;

0 commit comments

Comments
 (0)