catch and show exceptions thrown at adding message attachments
This commit is contained in:
parent
1adba70f3b
commit
09892e0078
|
@ -514,9 +514,13 @@ class ThreadActivity : SimpleActivity() {
|
||||||
|
|
||||||
if (attachmentUris.isNotEmpty()) {
|
if (attachmentUris.isNotEmpty()) {
|
||||||
for (uri in attachmentUris) {
|
for (uri in attachmentUris) {
|
||||||
val byteArray = contentResolver.openInputStream(uri)?.readBytes() ?: continue
|
try {
|
||||||
val mimeType = contentResolver.getType(uri) ?: continue
|
val byteArray = contentResolver.openInputStream(uri)?.readBytes() ?: continue
|
||||||
message.addMedia(byteArray, mimeType)
|
val mimeType = contentResolver.getType(uri) ?: continue
|
||||||
|
message.addMedia(byteArray, mimeType)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue