commit | 8d570b3a246cbc18be7046763c213b57dcb3e103 | [log] [tgz] |
---|---|---|
author | Jeff Hamilton <jham@android.com> | Thu Sep 17 11:51:32 2009 -0500 |
committer | Jeff Hamilton <jham@android.com> | Thu Sep 17 11:52:43 2009 -0500 |
tree | 041fb27b932dbfd20a3944160f8ebbb17c510137 | |
parent | 074c11c1649a097ba1beae719069f8d4a2dd43e3 [diff] |
Don't crash if the cursor is null. Change-Id: Ibbacc97f781c1485599a5e11217527930d97fe2d
diff --git a/core/java/android/provider/Contacts.java b/core/java/android/provider/Contacts.java index 667ec5a..d87018d 100644 --- a/core/java/android/provider/Contacts.java +++ b/core/java/android/provider/Contacts.java
@@ -533,7 +533,7 @@ Uri photoUri = Uri.withAppendedPath(person, Contacts.Photos.CONTENT_DIRECTORY); Cursor cursor = cr.query(photoUri, new String[]{Photos.DATA}, null, null, null); try { - if (!cursor.moveToNext()) { + if (cursor == null || !cursor.moveToNext()) { return null; } byte[] data = cursor.getBlob(0);