Fix NPE in MultiDeviceContactUpdateJob.

Fixes #8180
This commit is contained in:
Greyson Parrelli 2018-09-06 15:11:06 -07:00
parent 82c0ea792a
commit 7c5e1db6a2

View File

@ -240,6 +240,10 @@ public class MultiDeviceContactUpdateJob extends MasterSecretJob implements Inje
Uri displayPhotoUri = Uri.withAppendedPath(uri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO);
AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r");
if (fd == null) {
return Optional.absent();
}
return Optional.of(SignalServiceAttachment.newStreamBuilder()
.withStream(fd.createInputStream())
.withContentType("image/*")