From 7763d2f5f170da6b66e140cc9586ba287b146079 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 21 Mar 2023 13:02:52 +0100 Subject: [PATCH] Some fixes --- .../android/mastodon/activities/SearchResultTabActivity.java | 4 ++-- .../app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/SearchResultTabActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/SearchResultTabActivity.java index decb29d7..cbcb540c 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/SearchResultTabActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/SearchResultTabActivity.java @@ -280,13 +280,13 @@ public class SearchResultTabActivity extends BaseBarActivity { public void moveToAccount() { tagEmpty = null; accountEmpty = null; - binding.searchViewpager.setCurrentItem(1); + binding.searchViewpager.post(() -> binding.searchViewpager.setCurrentItem(1)); } public void moveToMessage() { tagEmpty = null; accountEmpty = null; - binding.searchViewpager.setCurrentItem(2); + binding.searchViewpager.post(() -> binding.searchViewpager.setCurrentItem(2)); } /** diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java index 8304bd94..191780ce 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java @@ -2837,6 +2837,9 @@ public class StatusAdapter extends RecyclerView.Adapter } int to = Math.min(position + siblings, max_size - 1); for (Status status : statusList.subList(from, to)) { + if (status == null) { + continue; + } Status statusToDeal = status.reblog != null ? status.reblog : status; if (statusToDeal.media_attachments != null && statusToDeal.media_attachments.size() > 0) { attachments.addAll(statusToDeal.media_attachments);