From e4523b6d7b6aed25e896b59f23b31d2a6b858744 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 31 Mar 2018 14:43:11 +0200 Subject: skip refresh if binding is missing --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 4 ++++ .../java/de/pixart/messenger/ui/ConversationsOverviewFragment.java | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/main/java/de') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index e310ed089..3ea9bfe5b 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -2120,6 +2120,10 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke @Override public void refresh() { + if (this.binding == null) { + Log.d(Config.LOGTAG, "ConversationFragment.refresh() skipped updated because view binding was null"); + return; + } this.refresh(true); } diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java index 6242e80a9..e5e5f509d 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsOverviewFragment.java @@ -146,6 +146,10 @@ public class ConversationsOverviewFragment extends XmppFragment { @Override void refresh() { + if (this.binding == null || this.activity == null) { + Log.d(Config.LOGTAG, "ConversationsOverviewFragment.refresh() skipped updated because view binding or activity was null"); + return; + } this.activity.xmppConnectionService.populateWithOrderedConversations(this.conversations); this.conversationsAdapter.notifyDataSetChanged(); } -- cgit v1.2.3