diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java index 81101684c..0d7f96942 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonAccount.java @@ -153,15 +153,16 @@ public class FragmentMastodonAccount extends Fragment { } accountsVM.getRelationships(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, ids) .observe(getViewLifecycleOwner(), relationShips -> { - - for (RelationShip relationShip : relationShips) { - for (Account account : accounts) { - if (account.id.compareToIgnoreCase(relationShip.id) == 0) { - account.relationShip = relationShip; + if (relationShips != null) { + for (RelationShip relationShip : relationShips) { + for (Account account : accounts) { + if (account.id.compareToIgnoreCase(relationShip.id) == 0) { + account.relationShip = relationShip; + } } } + accountAdapter.notifyItemRangeChanged(position, accounts.size()); } - accountAdapter.notifyItemRangeChanged(position, accounts.size()); }); } diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java index 0bf579995..ade637597 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTimeline.java @@ -788,7 +788,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter. accountsVM.getAccountStatuses(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, accountTimeline.id, null, null, null, null, null, false, true, MastodonHelper.statusesPerCall(requireActivity())) .observe(getViewLifecycleOwner(), pinnedStatuses -> accountsVM.getAccountStatuses(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, accountTimeline.id, null, null, null, exclude_replies, exclude_reblogs, media_only, false, MastodonHelper.statusesPerCall(requireActivity())) .observe(getViewLifecycleOwner(), otherStatuses -> { - if (otherStatuses != null && otherStatuses.statuses != null) { + if (otherStatuses != null && otherStatuses.statuses != null && pinnedStatuses != null) { for (Status status : pinnedStatuses.statuses) { status.pinned = true; }