diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index a77b30ca43..80a9cbb5f6 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -973,7 +973,7 @@ public static void setUserPreferredTheme(Context context, @Nullable AccountSessi default -> R.style.Theme_Mastodon_AutoLightDark; }); - AccountLocalPreferences prefs=session.getLocalPreferences(); + AccountLocalPreferences prefs=session != null ? session.getLocalPreferences() : null; AccountLocalPreferences.ColorPreference color=prefs != null ? prefs.color : AccountLocalPreferences.ColorPreference.MATERIAL3; ColorPalette palette = ColorPalette.palettes.get(color); if (palette != null) palette.apply(context, theme);