Fix NPE
bug: 6181736 Change-Id: I6522f19555c27f33c9ff4eaa8b2559a51a38f015
This commit is contained in:
parent
a50a34f8b4
commit
cbb5053b6c
1 changed files with 10 additions and 2 deletions
|
@ -115,8 +115,16 @@ public class UserBigramDictionary extends ExpandableDictionary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object bigram) {
|
public boolean equals(Object bigram) {
|
||||||
Bigram bigram2 = (Bigram) bigram;
|
if (!(bigram instanceof Bigram)) {
|
||||||
return (mWord1.equals(bigram2.mWord1) && mWord2.equals(bigram2.mWord2));
|
return false;
|
||||||
|
}
|
||||||
|
final Bigram bigram2 = (Bigram) bigram;
|
||||||
|
final boolean eq1 =
|
||||||
|
mWord1 == null ? bigram2.mWord1 == null : mWord1.equals(bigram2.mWord1);
|
||||||
|
if (!eq1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return mWord2 == null ? bigram2.mWord2 == null : mWord2.equals(bigram2.mWord2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue