Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b1570d28 authored by Johan Redestig's avatar Johan Redestig Committed by Yohei Yukawa
Browse files

Dont crash if there is no spellchecker

The fact that isSpellCheckerEnabled returns true does not mean
that getCurrentSpellChecker will return non null. By default
isSpellCheckerEnabled is true in TextServicesSettings, even when
there is no spellchecker service active on the device.

The issue can be verified by disabling the Google Keyboard (assuming
the GMS LatinImeGoogle is used) in Settings|Apps and later
entering Settings|Language & input. Without this patch Settings
crashes at that point with the following stack:

E/AndroidRuntime(13020): Caused by: java.lang.NullPointerException: \
Attempt to invoke virtual method 'java.lang.CharSequence android.vie\
w.textservice.SpellCheckerInfo.loadLabel(android.content.pm.PackageM\
anager)' on a null object reference
E/AndroidRuntime(13020):        at com.android.settings.inputmethod.\
InputMethodAndLanguageSettings.onResume(InputMethodAndLanguageSettin\
gs.java:253)
E/AndroidRuntime(13020):        at android.app.Fragment.performResum\
e(Fragment.java:2096)
E/AndroidRuntime(13020):        at android.app.FragmentManagerImpl.m\
oveToState(FragmentManager.java:928)
E/AndroidRuntime(13020):        at android.app.FragmentManagerImpl.m\
oveToState(FragmentManager.java:1067)

Bug: 19832033
Change-Id: I65e6d269572e064aa6897807b6611ef947d90211
parent 8ac57a16
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment