From ece087eaae699c47d4135546b6cbb119b78f03b5 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Wed, 4 Jan 2023 10:09:39 -0500 Subject: [PATCH] Require non-null uri in UriAttachment. Part of an effort to track down a different crash. This should make it more obvious where the error is being made. --- .../org/thoughtcrime/securesms/attachments/UriAttachment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/attachments/UriAttachment.java b/app/src/main/java/org/thoughtcrime/securesms/attachments/UriAttachment.java index c83f68b388..eb0fdad184 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/attachments/UriAttachment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/attachments/UriAttachment.java @@ -10,6 +10,8 @@ import org.thoughtcrime.securesms.blurhash.BlurHash; import org.thoughtcrime.securesms.database.AttachmentTable.TransformProperties; import org.thoughtcrime.securesms.stickers.StickerLocator; +import java.util.Objects; + public class UriAttachment extends Attachment { private final @NonNull Uri dataUri; @@ -51,7 +53,7 @@ public class UriAttachment extends Attachment { @Nullable TransformProperties transformProperties) { super(contentType, transferState, size, fileName, 0, null, null, null, null, fastPreflightId, voiceNote, borderless, videoGif, width, height, quote, 0, caption, stickerLocator, blurHash, audioHash, transformProperties); - this.dataUri = dataUri; + this.dataUri = Objects.requireNonNull(dataUri); } @Override