From e3500365955dd7fbd69ce81ccd92b940074c7dd2 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 29 May 2023 17:42:42 -0500 Subject: [PATCH] For some reason this caused all kinds of instability So back to the old strategy, but if it ends up wrong null it out. --- .../siacs/conversations/entities/Conversation.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 9d9ddd5ac8defabf558e9d1cb06cc684a3c667ba..79b90936aa20716be71b4e8f542291615af8c179 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -1385,17 +1385,19 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl if (oldConversation != null) { oldConversation.pagerAdapter.mPager = null; oldConversation.pagerAdapter.mTabs = null; - page1 = oldConversation.pagerAdapter.page1; - page2 = oldConversation.pagerAdapter.page2; - oldConversation.pagerAdapter.page1 = null; - oldConversation.pagerAdapter.page2 = null; } if (mPager == null) return; if (sessions != null) show(); - if (page1 == null) page1 = pager.getChildAt(0); - if (page2 == null) page2 = pager.getChildAt(1); + if (pager.getChildAt(0) != null) page1 = pager.getChildAt(0); + if (pager.getChildAt(1) != null) page2 = pager.getChildAt(1); + if (page2.findViewById(R.id.commands_view) == null) { + page1 = null; + page2 = null; + } + if (page1 == null) page1 = oldConversation.pagerAdapter.page1; + if (page2 == null) page2 = oldConversation.pagerAdapter.page2; if (page1 == null || page2 == null) { throw new IllegalStateException("page1 or page2 were not present as child or in model?"); }