diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2018-12-05 11:27:10 +0300 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2018-12-05 11:27:10 +0300 |
commit | fa5ba9e02bde82802f2489aa513d3b6ab7c56d8d (patch) | |
tree | 09e0a0b79d788b5cb9492ccde18a7e2be3b83aac /src | |
parent | c01bd38d0079259cf3ab913295bf97c9af3c4533 (diff) |
fixed some rare NPE caused by race for saveInstanceState()
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 7e001a55c..57af66a9e 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -595,8 +595,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(); |