Don't crash if the contacts provider returns a null Cursor.
diff --git a/src/com/android/inputmethod/latin/ContactsDictionary.java b/src/com/android/inputmethod/latin/ContactsDictionary.java
index 09cbd43..cfa1f1d 100644
--- a/src/com/android/inputmethod/latin/ContactsDictionary.java
+++ b/src/com/android/inputmethod/latin/ContactsDictionary.java
@@ -67,7 +67,9 @@
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;
}