From 176cbc9a28a814f57e6d410139dda427b2ababb6 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 10 Oct 2023 09:47:44 -0500 Subject: [PATCH] Fix crash trying to open link when no app for it --- .../eu/siacs/conversations/ui/ContactDetailsActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java index aae98fb6d..7ba00a729 100644 --- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -648,7 +648,11 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp switchToConversation(xmppConnectionService.findOrCreateConversation(account, Jid.of(uri.getSchemeSpecificPart()), false, true)); } else { Intent intent = new Intent(Intent.ACTION_VIEW, uri); - startActivity(intent); + try { + startActivity(intent); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.no_application_found_to_open_link, Toast.LENGTH_SHORT).show(); + } } }); binding.profileItems.setOnItemLongClickListener((a0, v, pos, a3) -> { -- 2.45.2