Fix crashes

This commit is contained in:
Thomas 2023-01-09 17:37:56 +01:00
parent 4ccd299fda
commit d97a78362c
2 changed files with 4 additions and 2 deletions

View file

@ -99,7 +99,9 @@ public class SpannableHelper {
public static Spannable convert(Context context, String text,
Status status, Account account, Announcement announcement,
WeakReference<View> viewWeakReference, Status.Callback callback) {
if (text == null) {
return null;
}
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
int currentNightMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
boolean customLight = sharedpreferences.getBoolean(context.getString(R.string.SET_CUSTOMIZE_LIGHT_COLORS), false);

View file

@ -74,7 +74,7 @@ public class FragmentMediaProfile extends Fragment {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
flagLoading = false;
accountsVM = new ViewModelProvider(FragmentMediaProfile.this).get(AccountsVM.class);
accountsVM = new ViewModelProvider(requireActivity()).get(AccountsVM.class);
mediaStatuses = new ArrayList<>();
if (checkRemotely) {