diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2010-11-12 15:26:54 -0800 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2010-11-12 15:26:54 -0800 |
| commit | d98c20b036ff02f99406dabb8cc4fdf4a51cd6c4 (patch) | |
| tree | 5c7b4fca2952c20eebfe5f1d60210aa74be8c543 /java/src/com/android/inputmethod | |
| parent | 6a567370ce0f78e89bc1f4a52e0af3c5634a349e (diff) | |
Fix NPE that is caused by null EditorInfo
Bug: 3192772
Change-Id: Ia057d29e070ccbb90ee60df1e141de14de95f820
Diffstat (limited to 'java/src/com/android/inputmethod')
| -rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 707821125..e0ce9c9c5 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -513,7 +513,8 @@ public class LatinIME extends InputMethodService mOrientation = conf.orientation; final int mode = mKeyboardSwitcher.getKeyboardMode(); final EditorInfo attribute = getCurrentInputEditorInfo(); - mKeyboardSwitcher.loadKeyboard(mode, attribute.imeOptions, mVoiceButtonEnabled, + final int imeOptions = (attribute != null) ? attribute.imeOptions : 0; + mKeyboardSwitcher.loadKeyboard(mode, imeOptions, mVoiceButtonEnabled, mVoiceButtonOnPrimary); } @@ -2273,7 +2274,8 @@ public class LatinIME extends InputMethodService } final int mode = mKeyboardSwitcher.getKeyboardMode(); final EditorInfo attribute = getCurrentInputEditorInfo(); - mKeyboardSwitcher.loadKeyboard(mode, attribute.imeOptions, mVoiceButtonEnabled, + final int imeOptions = (attribute != null) ? attribute.imeOptions : 0; + mKeyboardSwitcher.loadKeyboard(mode, imeOptions, mVoiceButtonEnabled, mVoiceButtonOnPrimary); initSuggest(mLanguageSwitcher.getInputLanguage()); mLanguageSwitcher.persist(); |
