Prevent NPE in ContactsContract
Bug 26730982 Change-Id: I36fdfffba79e0696175edd42bb131f92cba47499
This commit is contained in:
@@ -2079,10 +2079,11 @@ public final class ContactsContract {
|
||||
if (preferHighres) {
|
||||
final Uri displayPhotoUri = Uri.withAppendedPath(contactUri,
|
||||
Contacts.Photo.DISPLAY_PHOTO);
|
||||
InputStream inputStream;
|
||||
try {
|
||||
AssetFileDescriptor fd = cr.openAssetFileDescriptor(displayPhotoUri, "r");
|
||||
return fd.createInputStream();
|
||||
if (fd != null) {
|
||||
return fd.createInputStream();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// fallback to the thumbnail code
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user