From 10f1a4d39ca6ef7a869b513a9756d5170eee3b53 Mon Sep 17 00:00:00 2001 From: Jeff Hamilton Date: Tue, 18 Aug 2009 11:53:22 -0500 Subject: [PATCH] Don't crash if the contacts provider returns a null Cursor. --- src/com/android/inputmethod/latin/ContactsDictionary.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/inputmethod/latin/ContactsDictionary.java b/src/com/android/inputmethod/latin/ContactsDictionary.java index 09cbd43e9..cfa1f1d7d 100644 --- a/src/com/android/inputmethod/latin/ContactsDictionary.java +++ b/src/com/android/inputmethod/latin/ContactsDictionary.java @@ -67,7 +67,9 @@ public class ContactsDictionary extends ExpandableDictionary { private synchronized void loadDictionary() { Cursor cursor = getContext().getContentResolver() .query(People.CONTENT_URI, PROJECTION, null, null, null); - addWords(cursor); + if (cursor != null) { + addWords(cursor); + } mRequiresReload = false; }