Fixed nullpointer in PersonService
This commit is contained in:
parent
28e362231f
commit
1a6b13680c
1 changed files with 5 additions and 2 deletions
|
|
@ -74,8 +74,8 @@ public class PersonService {
|
|||
|
||||
List<PassportData> passports = mapper.findPassportData(fids);
|
||||
|
||||
Map<Integer, List<PassportData>> passportsMap = passports.stream()
|
||||
.collect(Collectors.groupingBy(PassportData::getFid));
|
||||
Map<Integer, List<PassportData>> passportsMap = passports.stream()
|
||||
.collect(Collectors.groupingBy(PassportData::getFid));
|
||||
|
||||
fids.forEach(fid -> {
|
||||
PassportData passport = findPassport(passportsMap.get(fid));
|
||||
|
|
@ -88,6 +88,9 @@ public class PersonService {
|
|||
}
|
||||
|
||||
private PassportData findPassport(List<PassportData> passports) {
|
||||
if (passports == null || passports.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
List<PassportData> documents = passports.stream()
|
||||
.filter(this::isDUL)
|
||||
.toList(); // берем только ДУЛ
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue