REQ-2010: fix NPE

This commit is contained in:
yanglin 2024-02-26 09:09:56 +08:00
parent 72a0c49ff1
commit 498cad19b4
2 changed files with 4 additions and 1 deletions

View File

@ -71,6 +71,9 @@ public class GeneralMessageOldServiceImpl implements GeneralMessageOldService {
}
public int countUnread(Long personId, List<IdentityDTO> identities, List<Long> excludeMsgIds) {
if (CollectionUtils.isEmpty(identities)) {
return 0;
}
int count = 0;
for (IdentityDTO identity : identities) {
PersonDTO person = PersonDTO.from(personId, identity.getId(), identity.getType());

View File

@ -42,7 +42,7 @@ public class GeneralMessageOldDataStatisticRequest implements Serializable {
if (identityId != null && identityType != null) {
return Collections.singletonList(new IdentityDTO(identityId, identityType));
}
return identities;
return identities == null ? Collections.emptyList() : identities;
}
@Override