am 2f77ffb0: Merge change 25503 into eclair

Merge commit '2f77ffb087892f9474b35cb019f593025653e492' into eclair-plus-aosp

* commit '2f77ffb087892f9474b35cb019f593025653e492':
  Don't crash if the cursor is null.
This commit is contained in:
Jeff Hamilton
2009-09-17 10:23:21 -07:00
committed by Android Git Automerger

View File

@@ -533,7 +533,7 @@ public class Contacts {
Uri photoUri = Uri.withAppendedPath(person, Contacts.Photos.CONTENT_DIRECTORY); Uri photoUri = Uri.withAppendedPath(person, Contacts.Photos.CONTENT_DIRECTORY);
Cursor cursor = cr.query(photoUri, new String[]{Photos.DATA}, null, null, null); Cursor cursor = cr.query(photoUri, new String[]{Photos.DATA}, null, null, null);
try { try {
if (!cursor.moveToNext()) { if (cursor == null || !cursor.moveToNext()) {
return null; return null;
} }
byte[] data = cursor.getBlob(0); byte[] data = cursor.getBlob(0);