Skip to content

Commit

Permalink
LatinIME: Fix NPE in KeyboardTheme
Browse files Browse the repository at this point in the history
Log:

06-08 17:33:02.758 E/KeyboardLayoutSet(5936): Can't create keyboard: [alphabet en_GB:qwerty 480x301 text actionUnspecified]
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.android.inputmethod.keyboard.KeyboardTheme.mThemeName' on a null object reference
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.KeyboardTheme.getKeyboardThemeName(KeyboardTheme.java:123)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseCaseCondition(KeyboardBuilder.java:653)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseCase(KeyboardBuilder.java:626)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseSwitchInternal(KeyboardBuilder.java:607)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseSwitchKeyboardContent(KeyboardBuilder.java:590)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:317)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseMerge(KeyboardBuilder.java:576)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeInternal(KeyboardBuilder.java:557)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeKeyboardContent(KeyboardBuilder.java:513)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:315)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseMerge(KeyboardBuilder.java:576)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeInternal(KeyboardBuilder.java:557)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeKeyboardContent(KeyboardBuilder.java:513)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:315)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboard(KeyboardBuilder.java:229)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.load(KeyboardBuilder.java:172)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:227)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:204)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService.createKeyboardForLocale(AndroidSpellCheckerService.java:234)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService.getKeyboardForLocale(AndroidSpellCheckerService.java:221)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidWordLevelSpellCheckerSession.onGetSuggestionsInternal(AndroidWordLevelSpellCheckerSession.java:275)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerSession.onGetSuggestionsMultiple(AndroidSpellCheckerSession.java:217)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerSession.splitAndSuggest(AndroidSpellCheckerSession.java:189)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerSession.onGetSentenceSuggestionsMultiple(AndroidSpellCheckerSession.java:129)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at android.service.textservice.SpellCheckerService$InternalISpellCheckerSession.onGetSentenceSuggestionsMultiple(SpellCheckerService.java:271)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at com.android.internal.textservice.ISpellCheckerSession$Stub.onTransact(ISpellCheckerSession.java:119)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at android.os.Binder.execTransactInternal(Binder.java:1021)
06-08 17:33:02.758 E/KeyboardLayoutSet(5936): 	at android.os.Binder.execTransact(Binder.java:994)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): Exception while spellchecking
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): com.android.inputmethod.keyboard.KeyboardLayoutSet$KeyboardLayoutSetException: java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.android.inputmethod.keyboard.KeyboardTheme.mThemeName' on a null object reference
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:207)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService.createKeyboardForLocale(AndroidSpellCheckerService.java:234)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService.getKeyboardForLocale(AndroidSpellCheckerService.java:221)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidWordLevelSpellCheckerSession.onGetSuggestionsInternal(AndroidWordLevelSpellCheckerSession.java:275)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerSession.onGetSuggestionsMultiple(AndroidSpellCheckerSession.java:217)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerSession.splitAndSuggest(AndroidSpellCheckerSession.java:189)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerSession.onGetSentenceSuggestionsMultiple(AndroidSpellCheckerSession.java:129)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at android.service.textservice.SpellCheckerService$InternalISpellCheckerSession.onGetSentenceSuggestionsMultiple(SpellCheckerService.java:271)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.internal.textservice.ISpellCheckerSession$Stub.onTransact(ISpellCheckerSession.java:119)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at android.os.Binder.execTransactInternal(Binder.java:1021)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at android.os.Binder.execTransact(Binder.java:994)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): Caused by: java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.android.inputmethod.keyboard.KeyboardTheme.mThemeName' on a null object reference
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.KeyboardTheme.getKeyboardThemeName(KeyboardTheme.java:123)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseCaseCondition(KeyboardBuilder.java:653)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseCase(KeyboardBuilder.java:626)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseSwitchInternal(KeyboardBuilder.java:607)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseSwitchKeyboardContent(KeyboardBuilder.java:590)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:317)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseMerge(KeyboardBuilder.java:576)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeInternal(KeyboardBuilder.java:557)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeKeyboardContent(KeyboardBuilder.java:513)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:315)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseMerge(KeyboardBuilder.java:576)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeInternal(KeyboardBuilder.java:557)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeKeyboardContent(KeyboardBuilder.java:513)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:315)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboard(KeyboardBuilder.java:229)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.internal.KeyboardBuilder.load(KeyboardBuilder.java:172)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:227)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:204)
06-08 17:33:02.758 E/AndroidWordLevelSpellCheckerSession(5936): 	... 10 more

Signed-off-by: Pranav Vashi <[email protected]>
Signed-off-by: Pranav Temkar <[email protected]>
  • Loading branch information
neobuddy89 authored and PptO07 committed Jan 31, 2024
1 parent 64ea783 commit 7aefba8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static String getKeyboardThemeName(final int themeId) {
if (theme == null) {
theme = searchKeyboardThemeById(DEFAULT_THEME_ID, KEYBOARD_THEMES);
}
return theme.mThemeName;
return theme != null ? theme.mThemeName : null;
}

public static void saveKeyboardThemeId(final int themeId, final SharedPreferences prefs) {
Expand Down

0 comments on commit 7aefba8

Please sign in to comment.