From 53369eb2d439ae5f4c588f1001897aa343eeca6f Mon Sep 17 00:00:00 2001 From: Jacoco <63549689+Jacocococo@users.noreply.github.com> Date: Fri, 1 Sep 2023 21:28:02 +0200 Subject: [PATCH] Fix unreliable Preferences from Account Source (#798) * Create empty Preferences object on error * Update prefs from account when preferences fails --- .../org/joinmastodon/android/api/session/AccountSession.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSession.java b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSession.java index fde8cc566..fa7a85eb1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSession.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSession.java @@ -146,6 +146,9 @@ public class AccountSession{ @Override public void onError(ErrorResponse error){ Log.w(TAG, "Failed to load preferences for account "+getID()+": "+error); + if (preferences==null) + preferences=new Preferences(); + preferencesFromAccountSource(self); } }) .exec(getID());