if requery returns false, throw exception

bug:2894145
Change-Id: Iba36031fae90e53a6c71677e3ec23ba017234407
This commit is contained in:
Vasu Nori
2010-08-05 11:32:54 -07:00
parent 05411893af
commit d334d52c47

View File

@@ -251,7 +251,9 @@ public class UserDictionarySettings extends ListActivity {
// TODO: present UI for picking whether to add word to all locales, or current.
UserDictionary.Words.addWord(this, word.toString(),
250, UserDictionary.Words.LOCALE_TYPE_ALL);
mCursor.requery();
if (!mCursor.requery()) {
throw new IllegalStateException("can't requery on already-closed cursor.");
}
mAddedWordAlready = true;
}