Skip to content

Commit 1339c44

Browse files
Fix potential crash when backing up attachment.
1 parent 8499402 commit 1339c44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/java/org/thoughtcrime/securesms/jobs/UploadAttachmentToArchiveJob.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ class UploadAttachmentToArchiveJob private constructor(
121121
return Result.failure()
122122
}
123123

124+
if (attachment.uri == null) {
125+
Log.w(TAG, "[$attachmentId] Attachment has no uri! Cannot upload.")
126+
return Result.failure()
127+
}
128+
124129
if (attachment.archiveTransferState == AttachmentTable.ArchiveTransferState.FINISHED) {
125130
Log.i(TAG, "[$attachmentId] Already finished. Skipping.")
126131
return Result.success()

0 commit comments

Comments
 (0)