commit | 1e94cb5d34c52c528b8210f719547fc5603593ce | [log] [tgz] |
---|---|---|
author | Yorke Lee <yorkelee@google.com> | Thu Dec 05 11:20:53 2013 -0800 |
committer | Yorke Lee <yorkelee@google.com> | Thu Dec 05 11:22:50 2013 -0800 |
tree | 88c67f97af4f1a9c982e57aa6df05fa779624a1e | |
parent | d4793dcdd624e3b6026a56b6e9ab76b8f7a51f69 [diff] |
Add null check for cursor in DirectoryListLoader Bug: 12015142 Change-Id: Iaf7a97efb31e06402d583d399fa1f66f12e086d9
diff --git a/src/com/android/contacts/common/list/DirectoryListLoader.java b/src/com/android/contacts/common/list/DirectoryListLoader.java index be9a8e9..dedd62e 100644 --- a/src/com/android/contacts/common/list/DirectoryListLoader.java +++ b/src/com/android/contacts/common/list/DirectoryListLoader.java
@@ -147,6 +147,9 @@ Cursor cursor = context.getContentResolver().query(DirectoryQuery.URI, DirectoryQuery.PROJECTION, selection, null, DirectoryQuery.ORDER_BY); + if (cursor == null) { + return result; + } try { while(cursor.moveToNext()) { long directoryId = cursor.getLong(DirectoryQuery.ID);