Move the exception test
This commit is contained in:
parent
90c55806c0
commit
eec8a50caf
1 changed files with 14 additions and 10 deletions
|
@ -62,9 +62,12 @@ bool setRandomInBuffer(JNIEnv *env, uint8_t **aBuffer2Ptr, size_t aRandomSize)
|
|||
newObj = env->NewObject(cls, constructor);
|
||||
jbyteArray tempByteArray = env->NewByteArray(bufferLen);
|
||||
|
||||
if (newObj && tempByteArray && !env->ExceptionOccurred())
|
||||
if (newObj && tempByteArray)
|
||||
{
|
||||
env->CallVoidMethod(newObj, nextByteMethod, tempByteArray);
|
||||
|
||||
if (!env->ExceptionOccurred())
|
||||
{
|
||||
jbyte* buffer = env->GetByteArrayElements(tempByteArray, NULL);
|
||||
|
||||
if (buffer)
|
||||
|
@ -80,6 +83,7 @@ bool setRandomInBuffer(JNIEnv *env, uint8_t **aBuffer2Ptr, size_t aRandomSize)
|
|||
env->ReleaseByteArrayElements(tempByteArray, buffer, JNI_ABORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tempByteArray)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue