Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
fix null reference
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Oct 6, 2023
1 parent b5b3cb4 commit 43e7374
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 43e7374

Please sign in to comment.