Return NOT_A_PROBABILITY in getProbability for inalid dictionary.
Bug: 9682742 Change-Id: Ifad4b9811bb5e1a94aed59eba7aedcdb6da5cf9cmain
parent
d365d82d51
commit
72f69fd621
|
@ -201,7 +201,7 @@ static int latinime_BinaryDictionary_getSuggestions(JNIEnv *env, jclass clazz, j
|
||||||
static jint latinime_BinaryDictionary_getProbability(JNIEnv *env, jclass clazz, jlong dict,
|
static jint latinime_BinaryDictionary_getProbability(JNIEnv *env, jclass clazz, jlong dict,
|
||||||
jintArray word) {
|
jintArray word) {
|
||||||
Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict);
|
Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict);
|
||||||
if (!dictionary) return 0;
|
if (!dictionary) return NOT_A_PROBABILITY;
|
||||||
const jsize wordLength = env->GetArrayLength(word);
|
const jsize wordLength = env->GetArrayLength(word);
|
||||||
int codePoints[wordLength];
|
int codePoints[wordLength];
|
||||||
env->GetIntArrayRegion(word, 0, wordLength, codePoints);
|
env->GetIntArrayRegion(word, 0, wordLength, codePoints);
|
||||||
|
|
Loading…
Reference in New Issue