From f496fc8fedaef0eb7655e7032d9e19c570095559 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 14 Dec 2018 20:30:35 +0100 Subject: fixed some rare NPE caused by race for saveInstanceState() --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 4f5d2892c..2082c6664 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -705,8 +705,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } private ScrollState getScrollPosition() { - final ListView listView = this.binding.messagesView; - if (listView.getCount() == 0 || listView.getLastVisiblePosition() == listView.getCount() - 1) { + final ListView listView = this.binding == null ? null : this.binding.messagesView; + if (listView == null || listView.getCount() == 0 || listView.getLastVisiblePosition() == listView.getCount() - 1) { return null; } else { final int pos = listView.getFirstVisiblePosition(); -- cgit v1.2.3