mirror of
https://github.com/FossifyOrg/Messages.git
synced 2026-06-19 13:59:06 -04:00
catch and show exceptions thrown at adding message attachments
This commit is contained in:
@@ -514,9 +514,13 @@ class ThreadActivity : SimpleActivity() {
|
||||
|
||||
if (attachmentUris.isNotEmpty()) {
|
||||
for (uri in attachmentUris) {
|
||||
val byteArray = contentResolver.openInputStream(uri)?.readBytes() ?: continue
|
||||
val mimeType = contentResolver.getType(uri) ?: continue
|
||||
message.addMedia(byteArray, mimeType)
|
||||
try {
|
||||
val byteArray = contentResolver.openInputStream(uri)?.readBytes() ?: continue
|
||||
val mimeType = contentResolver.getType(uri) ?: continue
|
||||
message.addMedia(byteArray, mimeType)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user