From ba9596b37d3f173b15426f36d241104267ffc596 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 20 Sep 2021 10:07:38 +0200 Subject: [PATCH] catch rare exception around execute pending fragment transactions --- .../siacs/conversations/ui/ConversationsActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java index 9ed1e3883..2c2c4fe48 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java @@ -430,7 +430,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio private void openConversation(Conversation conversation, Bundle extras) { final FragmentManager fragmentManager = getSupportFragmentManager(); - fragmentManager.executePendingTransactions(); + executePendingTransactions(fragmentManager); ConversationFragment conversationFragment = (ConversationFragment) fragmentManager.findFragmentById(R.id.secondary_fragment); final boolean mainNeedsRefresh; if (conversationFragment == null) { @@ -462,6 +462,14 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio } } + private static void executePendingTransactions(final FragmentManager fragmentManager) { + try { + fragmentManager.executePendingTransactions(); + } catch (final Exception e) { + Log.e(Config.LOGTAG,"unable to execute pending fragment transactions"); + } + } + public boolean onXmppUriClicked(Uri uri) { XmppUri xmppUri = new XmppUri(uri); if (xmppUri.isValidJid() && !xmppUri.hasFingerprints()) {