Fix a crash in the dictionary due to releasing a null array.

main
Amith Yamasani 2010-02-09 10:58:26 -08:00
parent 1b62ff1a3d
commit df4e0430de
1 changed files with 5 additions and 3 deletions

View File

@ -107,7 +107,9 @@ static int latinime_BinaryDictionary_getSuggestions(
env->ReleaseIntArrayElements(frequencyArray, frequencies, 0); env->ReleaseIntArrayElements(frequencyArray, frequencies, 0);
env->ReleaseIntArrayElements(inputArray, inputCodes, JNI_ABORT); env->ReleaseIntArrayElements(inputArray, inputCodes, JNI_ABORT);
env->ReleaseCharArrayElements(outputArray, outputChars, 0); env->ReleaseCharArrayElements(outputArray, outputChars, 0);
env->ReleaseIntArrayElements(nextLettersArray, nextLetters, 0); if (nextLetters) {
env->ReleaseIntArrayElements(nextLettersArray, nextLetters, 0);
}
return count; return count;
} }