Fix a crashing bug

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-04-16 15:04:11 +02:00
parent ab4d76b227
commit 8a07e94e0e

View file

@ -468,21 +468,27 @@ public class ConversationsListController extends BaseController implements Searc
@Override @Override
public void onChanged() { public void onChanged() {
super.onChanged(); super.onChanged();
recyclerView.smoothScrollToPosition(scrollTo); if (recyclerView != null) {
recyclerView.smoothScrollToPosition(scrollTo);
}
lastClickedConversationToken = ""; lastClickedConversationToken = "";
} }
@Override @Override
public void onItemRangeChanged(int positionStart, int itemCount) { public void onItemRangeChanged(int positionStart, int itemCount) {
super.onItemRangeChanged(positionStart, itemCount); super.onItemRangeChanged(positionStart, itemCount);
recyclerView.smoothScrollToPosition(scrollTo); if (recyclerView != null) {
recyclerView.smoothScrollToPosition(scrollTo);
}
lastClickedConversationToken = ""; lastClickedConversationToken = "";
} }
@Override @Override
public void onItemRangeChanged(int positionStart, int itemCount, @Nullable Object payload) { public void onItemRangeChanged(int positionStart, int itemCount, @Nullable Object payload) {
super.onItemRangeChanged(positionStart, itemCount, payload); super.onItemRangeChanged(positionStart, itemCount, payload);
recyclerView.smoothScrollToPosition(scrollTo); if (recyclerView != null) {
recyclerView.smoothScrollToPosition(scrollTo);
}
lastClickedConversationToken = ""; lastClickedConversationToken = "";
} }
}); });