am 4358731c
: Merge change 22534 into eclair
Merge commit '4358731c98929e2d5af70b0c4983a872386569bd' into eclair-plus-aosp * commit '4358731c98929e2d5af70b0c4983a872386569bd': ContactsContract: Fix null pointer exception in openContactPhotoInputStream()
This commit is contained in:
@ -343,7 +343,7 @@ public final class ContactsContract {
|
|||||||
Cursor cursor = cr.query(photoUri,
|
Cursor cursor = cr.query(photoUri,
|
||||||
new String[]{ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null);
|
new String[]{ContactsContract.CommonDataKinds.Photo.PHOTO}, 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);
|
||||||
@ -352,10 +352,12 @@ public final class ContactsContract {
|
|||||||
}
|
}
|
||||||
return new ByteArrayInputStream(data);
|
return new ByteArrayInputStream(data);
|
||||||
} finally {
|
} finally {
|
||||||
|
if (cursor != null) {
|
||||||
cursor.close();
|
cursor.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private interface RawContactsColumns {
|
private interface RawContactsColumns {
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user