fixed some rare NPE caused by race for saveInstanceState()
This commit is contained in:
parent
c01bd38d00
commit
fa5ba9e02b
|
@ -595,8 +595,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScrollState getScrollPosition() {
|
private ScrollState getScrollPosition() {
|
||||||
final ListView listView = this.binding.messagesView;
|
final ListView listView = this.binding == null ? null : this.binding.messagesView;
|
||||||
if (listView.getCount() == 0 || listView.getLastVisiblePosition() == listView.getCount() - 1) {
|
if (listView == null || listView.getCount() == 0 || listView.getLastVisiblePosition() == listView.getCount() - 1) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
final int pos = listView.getFirstVisiblePosition();
|
final int pos = listView.getFirstVisiblePosition();
|
||||||
|
|
Loading…
Reference in a new issue