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

Commit 7d6eb9a4 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

ContactsContract: Fix null pointer exception in openContactPhotoInputStream()

parent ec9fe467
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ public final class ContactsContract {
            Cursor cursor = cr.query(photoUri,
                    new String[]{ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null);
            try {
                if (!cursor.moveToNext()) {
                if (cursor == null || !cursor.moveToNext()) {
                    return null;
                }
                byte[] data = cursor.getBlob(0);
@@ -352,10 +352,12 @@ public final class ContactsContract {
                }
                return new ByteArrayInputStream(data);
            } finally {
                if (cursor != null) {
                    cursor.close();
                }
            }
        }
    }

    private interface RawContactsColumns {
        /**