From 14656472a922bcc7f36a2bef73933f36901917be Mon Sep 17 00:00:00 2001 From: Grishka Date: Wed, 13 Apr 2022 19:35:39 +0300 Subject: [PATCH] Fix crashes --- .../android/fragments/BaseStatusListFragment.java | 5 ++++- .../android/fragments/discover/DiscoverAccountsFragment.java | 2 ++ .../fragments/onboarding/InstanceCatalogFragment.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java index af6f9dbd..a20a0864 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -216,7 +216,8 @@ public abstract class BaseStatusListFragment exten view.setScaleX(1f); view.setScaleY(1f); transitioningHolder.itemView.setElevation(0f); - list.setClipChildren(true); + if(list!=null) + list.setClipChildren(true); transitioningHolder=null; } @@ -596,6 +597,8 @@ public abstract class BaseStatusListFragment exten @Override public ImageLoaderRequest getImageRequest(int position, int image){ + if(position>=displayItems.size()) // TODO fix this in the image loader, these crashes are driving me crazy + return null; return displayItems.get(position).getImageRequest(image); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverAccountsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverAccountsFragment.java index 7b77b518..05970bd0 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverAccountsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/discover/DiscoverAccountsFragment.java @@ -107,6 +107,8 @@ public class DiscoverAccountsFragment extends BaseRecyclerFragment result){ relationshipsRequest=null; relationships=result.stream().collect(Collectors.toMap(rel->rel.id, Function.identity())); + if(list==null) + return; for(int i=0;i