From 7c5e1db6a20fbf7b9ab25c1eaf7439bdefff2b16 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Thu, 6 Sep 2018 15:11:06 -0700 Subject: [PATCH] Fix NPE in MultiDeviceContactUpdateJob. Fixes #8180 --- .../securesms/jobs/MultiDeviceContactUpdateJob.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java b/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java index a16410f5ce..b9556e1e8c 100644 --- a/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java @@ -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/*")