From e7094beab9a9bcb66f2e40eae1c781867602c895 Mon Sep 17 00:00:00 2001 From: Grishka Date: Sun, 23 Jun 2024 04:54:43 +0300 Subject: [PATCH] More crash fixes --- mastodon/build.gradle | 2 +- .../fragments/onboarding/InstanceCatalogSignupFragment.java | 1 + .../fragments/onboarding/InstanceChooserLoginFragment.java | 2 ++ .../android/fragments/settings/EditFilterFragment.java | 6 ++++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mastodon/build.gradle b/mastodon/build.gradle index 902a95a6..c3821d22 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -14,7 +14,7 @@ android { minSdk 23 targetSdk 33 versionCode 104 - versionName "2.5.2" + versionName "2.5.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogSignupFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogSignupFragment.java index 68a9c890..765941d4 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogSignupFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceCatalogSignupFragment.java @@ -144,6 +144,7 @@ public class InstanceCatalogSignupFragment extends InstanceCatalogFragment{ @Override public void onDestroy(){ + removeBackCallback(exitQueryModeCallback); super.onDestroy(); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceChooserLoginFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceChooserLoginFragment.java index 38ed1c53..b1ea1128 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceChooserLoginFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/InstanceChooserLoginFragment.java @@ -100,6 +100,8 @@ public class InstanceChooserLoginFragment extends InstanceCatalogFragment{ .setCallback(new Callback<>(){ @Override public void onSuccess(List result){ + if(getActivity()==null) + return; data.clear(); data.addAll(sortInstances(result)); updateFilteredList(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/EditFilterFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/EditFilterFragment.java index 83f1f43f..3f3e4ada 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/EditFilterFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/EditFilterFragment.java @@ -97,6 +97,12 @@ public class EditFilterFragment extends BaseSettingsFragment{ setRetainInstance(true); } + @Override + public void onDestroy(){ + removeBackCallback(confirmCallback); + super.onDestroy(); + } + @Override protected void doLoadData(int offset, int count){}