Making sure we do not crash when trying to open a document that hasn't yet been downloaded

pull/1710/head
ThomasSession 1 month ago
parent e95fa6cc03
commit fd45cdf568

@ -193,6 +193,7 @@ class VisibleMessageContentView : ConstraintLayout {
message.slideDeck.documentSlide?.let { slide ->
onContentClick.add {
// open the document when tapping it
try {
val intent = Intent(Intent.ACTION_VIEW)
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
intent.setDataAndType(
@ -200,7 +201,6 @@ class VisibleMessageContentView : ConstraintLayout {
slide.contentType
)
try {
context.startActivity(intent)
} catch (e: ActivityNotFoundException) {
Log.e("VisibleMessageContentView", "Error opening document", e)

Loading…
Cancel
Save