Do not crash when the user dictionary service is disabled.

This still does not remove the UI. It only prevents the Settings
application from crashing.

Bug: 5024166
Change-Id: I6e8c0a8953af6c02273de2a881e85a5248cb8bd6
This commit is contained in:
Jean Chalard
2011-07-21 18:10:20 +09:00
parent c29c6d3f8c
commit ea41e087f9
2 changed files with 12 additions and 9 deletions

View File

@@ -49,7 +49,7 @@ public class UserDictionaryList extends SettingsPreferenceFragment {
new String[] { UserDictionary.Words.LOCALE },
null, null, null);
final Set<String> localeList = new TreeSet<String>();
if (cursor.moveToFirst()) {
if (null != cursor && cursor.moveToFirst()) {
final int columnIndex = cursor.getColumnIndex(UserDictionary.Words.LOCALE);
do {
String locale = cursor.getString(columnIndex);