am 169acbf9: Add null check in createDistracterFilter().

* commit '169acbf9f0127c7b6a95592fc412524d27b50953':
  Add null check in createDistracterFilter().
main
Keisuke Kuroyanagi 2014-04-25 20:42:45 +00:00 committed by Android Git Automerger
commit a11b60ac33
1 changed files with 5 additions and 1 deletions

View File

@ -543,7 +543,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private DistracterFilter createDistracterFilter() {
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
final Keyboard keyboard = mainKeyboardView.getKeyboard();
// TODO: Create Keyboard when mainKeyboardView is null.
// TODO: Figure out the most reasonable keyboard for the filter. Refer to the
// spellchecker's logic.
final Keyboard keyboard = (mainKeyboardView != null) ?
mainKeyboardView.getKeyboard() : null;
final DistracterFilter distracterFilter = new DistracterFilter(mInputLogic.mSuggest,
keyboard);
return distracterFilter;