Fix potential crash when backing up attachment.

This commit is contained in:
Greyson Parrelli
2025-09-05 23:38:57 -04:00
parent 8499402831
commit 1339c44892

View File

@@ -121,6 +121,11 @@ class UploadAttachmentToArchiveJob private constructor(
return Result.failure()
}
if (attachment.uri == null) {
Log.w(TAG, "[$attachmentId] Attachment has no uri! Cannot upload.")
return Result.failure()
}
if (attachment.archiveTransferState == AttachmentTable.ArchiveTransferState.FINISHED) {
Log.i(TAG, "[$attachmentId] Already finished. Skipping.")
return Result.success()