From 21c9ffd8b2d3b482b7f6d39afcd3e311ab79bdb5 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 25 Feb 2018 15:43:19 +0100 Subject: [PATCH] skip refresh if binding is missing --- .../java/eu/siacs/conversations/ui/ConversationFragment.java | 4 ++++ .../siacs/conversations/ui/ConversationsOverviewFragment.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index b374e1730..9321c4809 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1826,6 +1826,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/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index 3673065a5..db47bc0b9 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -154,6 +154,10 @@ public class ConversationsOverviewFragment extends XmppFragment implements Enhan @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); Conversation removed = this.swipedConversation.peek(); if (removed != null) {