Merge pull request #280 from sk22/fix-notifications-crash

Check whether title status item is null to fix null pointer exception
This commit is contained in:
Gregory K 2022-11-03 00:27:07 +03:00 committed by GitHub
commit 98dafb4e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import org.parceler.Parcels;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -76,9 +77,11 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
if(titleItem!=null) if(titleItem!=null)
items.add(0, titleItem); items.add(0, titleItem);
return items; return items;
}else{ }else if(titleItem!=null){
AccountCardStatusDisplayItem card=new AccountCardStatusDisplayItem(n.id, this, n.account); AccountCardStatusDisplayItem card=new AccountCardStatusDisplayItem(n.id, this, n.account);
return Arrays.asList(titleItem, card); return Arrays.asList(titleItem, card);
}else{
return Collections.emptyList();
} }
} }