mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 19:29:54 +01:00
Fix crash when downloading attachment from S3.
This commit is contained in:
committed by
Cody Henthorne
parent
36a8a399d9
commit
7735ca9dab
@@ -416,11 +416,15 @@ class AttachmentDownloadJob private constructor(
|
||||
if (body.contentLength() > RemoteConfig.maxAttachmentReceiveSizeBytes) {
|
||||
throw MmsException("Attachment too large, failing download")
|
||||
}
|
||||
|
||||
SignalDatabase.attachments.createKeyIvIfNecessary(attachmentId)
|
||||
val updatedAttachment = SignalDatabase.attachments.getAttachment(attachmentId)!!
|
||||
|
||||
SignalDatabase.attachments.finalizeAttachmentAfterDownload(
|
||||
messageId,
|
||||
attachmentId,
|
||||
LimitedInputStream.withoutLimits((body.source() as Source).buffer().inputStream()),
|
||||
iv = null
|
||||
iv = updatedAttachment.remoteIv
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user