fix(notificationsListFragment): fix crash when notification markers are null

This would happen when an account had 0 notifications and received one. After which, the user would tap on the notification icon on the tab bar and the app would crash.
Merge this @sk22, as this is a thing that might also happen on megalodon
This commit is contained in:
LucasGGamerM 2023-04-28 15:10:14 -03:00
parent 251ffbba8d
commit 4e13f868fd
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
loadRelationships(needRelationships);
maxID=result.maxID;
if(offset==0 && !result.items.isEmpty() && !result.isFromCache()){
if(offset==0 && !result.items.isEmpty() && !result.isFromCache() && AccountSessionManager.getInstance().getAccount(accountID).markers.notifications != null){
E.post(new AllNotificationsSeenEvent());
new SaveMarkers(null, result.items.get(0).id).exec(accountID);
AccountSessionManager.getInstance().getAccount(accountID).markers