From 5e948b1ac42ad44c0207d00144d32e1611ccf7a6 Mon Sep 17 00:00:00 2001 From: ylecollen Date: Tue, 3 Jan 2017 11:04:06 +0100 Subject: Add exception checks --- java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_jni_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java/android/OlmLibSdk/olm-sdk') diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_jni_helper.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_jni_helper.cpp index 767fad4..c649d32 100644 --- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_jni_helper.cpp +++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_jni_helper.cpp @@ -62,7 +62,7 @@ bool setRandomInBuffer(JNIEnv *env, uint8_t **aBuffer2Ptr, size_t aRandomSize) newObj = env->NewObject(cls, constructor); jbyteArray tempByteArray = env->NewByteArray(bufferLen); - if (newObj && tempByteArray) + if (newObj && tempByteArray && !env->ExceptionOccurred()) { env->CallVoidMethod(newObj, nextByteMethod, tempByteArray); jbyte* buffer = env->GetByteArrayElements(tempByteArray, NULL); -- cgit v1.2.3