aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-12-14 20:30:35 +0100
committerChristian Schneppe <christian@pix-art.de>2018-12-14 20:30:35 +0100
commitf496fc8fedaef0eb7655e7032d9e19c570095559 (patch)
tree277f1065bb52aa4cd458260d6fddb37ea5f85f83 /src/main
parent89ba17150d4056a5cb4ef4171e9ccdfe7d1a4fee (diff)
fixed some rare NPE caused by race for saveInstanceState()
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java4
1 files changed, 2 insertions, 2 deletions
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();