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

* commit '169acbf9f0127c7b6a95592fc412524d27b50953':
  Add null check in createDistracterFilter().
This commit is contained in:
Keisuke Kuroyanagi 2014-04-25 20:42:45 +00:00 committed by Android Git Automerger
commit a11b60ac33

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;