Resolves issue #15210 (#15212)

Signed-off-by: clinique <gael@lhopital.org>
This commit is contained in:
Gaël L'hopital 2023-07-12 08:44:15 +02:00 committed by GitHub
parent 0ad8cfbb62
commit 451aeb6b4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,14 +39,17 @@ public class HomeData extends NAThing implements NAModule, LocationEx {
}
public class Security extends HomeData {
private NAObjectMap<HomeDataPerson> persons = new NAObjectMap<>();
private @Nullable NAObjectMap<HomeDataPerson> persons;
public NAObjectMap<HomeDataPerson> getPersons() {
return persons;
NAObjectMap<HomeDataPerson> localPersons = persons;
return localPersons != null ? localPersons : new NAObjectMap<>();
}
public List<HomeDataPerson> getKnownPersons() {
return persons.values().stream().filter(HomeDataPerson::isKnown).toList();
NAObjectMap<HomeDataPerson> localPersons = persons;
return localPersons != null ? localPersons.values().stream().filter(HomeDataPerson::isKnown).toList()
: List.of();
}
}