am 3f805418
: Merge "Fix an OOB exception" into jb-mr1-dev
* commit '3f80541844672a7625eb298adc6141ecf14bb883': Fix an OOB exception
This commit is contained in:
commit
53f4acf86f
1 changed files with 5 additions and 2 deletions
|
@ -654,9 +654,12 @@ public class ExpandableDictionary extends Dictionary {
|
||||||
--index;
|
--index;
|
||||||
mLookedUpString[index] = node.mCode;
|
mLookedUpString[index] = node.mCode;
|
||||||
node = node.mParent;
|
node = node.mParent;
|
||||||
} while (node != null);
|
} while (node != null && index > 0);
|
||||||
|
|
||||||
if (freq >= 0) {
|
// If node is null, we have a word longer than MAX_WORD_LENGTH in the dictionary.
|
||||||
|
// It's a little unclear how this can happen, but just in case it does it's safer
|
||||||
|
// to ignore the word in this case.
|
||||||
|
if (freq >= 0 && node == null) {
|
||||||
suggestions.add(new SuggestedWordInfo(new String(mLookedUpString, index,
|
suggestions.add(new SuggestedWordInfo(new String(mLookedUpString, index,
|
||||||
BinaryDictionary.MAX_WORD_LENGTH - index),
|
BinaryDictionary.MAX_WORD_LENGTH - index),
|
||||||
freq, SuggestedWordInfo.KIND_CORRECTION, mDictType));
|
freq, SuggestedWordInfo.KIND_CORRECTION, mDictType));
|
||||||
|
|
Loading…
Reference in a new issue