Fix crash reported by rageshake: writeToFile may throw exceptions
This commit is contained in:
parent
1c727c1ee4
commit
42cdb1db11
|
@ -83,12 +83,10 @@ internal class DefaultFileService @Inject constructor(private val context: Conte
|
|||
|
||||
if (elementToDecrypt != null) {
|
||||
Timber.v("## decrypt file")
|
||||
MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt) ?: throw IllegalStateException("Decryption error")
|
||||
} else {
|
||||
inputStream
|
||||
MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt)
|
||||
?: throw IllegalStateException("Decryption error")
|
||||
}
|
||||
}
|
||||
.map { inputStream ->
|
||||
|
||||
writeToFile(inputStream, destFile)
|
||||
destFile
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue