diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index b3619730..0daf53b7 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -547,8 +547,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList .setCallback(new Callback<>(){ @Override public void onSuccess(List result){ - relationship=result.get(0); - updateRelationship(); + if(!result.isEmpty()){ + relationship=result.get(0); + updateRelationship(); + } } @Override diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogFragment.java index 3728d6a2..b143fdf2 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogFragment.java @@ -401,9 +401,11 @@ public class InstanceCatalogFragment extends BaseRecyclerFragment{ - loadingInstanceRequest.cancel(); - loadingInstanceRequest=null; - loadingInstanceDomain=null; + if(loadingInstanceRequest!=null){ + loadingInstanceRequest.cancel(); + loadingInstanceRequest=null; + loadingInstanceDomain=null; + } }); instanceProgressDialog.show(); }