Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da072b3e authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Prevent NPE in ContactsContract

Bug 26730982

Change-Id: I36fdfffba79e0696175edd42bb131f92cba47499
parent e3936dcf
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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");
                    if (fd != null) {
                        return fd.createInputStream();
                    }
                } catch (IOException e) {
                    // fallback to the thumbnail code
                }