diff options
author | 2011-07-21 02:27:27 -0700 | |
---|---|---|
committer | 2011-07-21 02:27:27 -0700 | |
commit | 3be0039164f5e2060b83d0699e293ffc76384732 (patch) | |
tree | 14bb6cdb789ef013638b3d072df8063d7272b9c3 /java/src | |
parent | d85bc7221c5300e9b0be2bc1b434303925cfec39 (diff) | |
download | latinime-3be0039164f5e2060b83d0699e293ffc76384732.tar.gz latinime-3be0039164f5e2060b83d0699e293ffc76384732.tar.xz latinime-3be0039164f5e2060b83d0699e293ffc76384732.zip |
Fix potential NPE
Change-Id: I3679d24b6c89e081d24d59c91b136c139dcb3d5c
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 5d8fd3411..64f7e6011 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -546,8 +546,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // know now whether this is a password text field, because we need to know now whether we // want to enable the voice button. final VoiceProxy voiceIme = mVoiceProxy; - voiceIme.resetVoiceStates(InputTypeCompatUtils.isPasswordInputType(attribute.inputType) - || InputTypeCompatUtils.isVisiblePasswordInputType(attribute.inputType)); + final int inputType = (attribute != null) ? attribute.inputType : 0; + voiceIme.resetVoiceStates(InputTypeCompatUtils.isPasswordInputType(inputType) + || InputTypeCompatUtils.isVisiblePasswordInputType(inputType)); initializeInputAttributes(attribute); |