From 9b5654e253ed3dedfb43125a0611896dfa8fc863 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 8 Sep 2022 08:03:04 -0700 Subject: Handle unlinked notifications --- src/main/java/org/traccar/session/cache/CacheManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/session/cache/CacheManager.java b/src/main/java/org/traccar/session/cache/CacheManager.java index 6f6b648fa..64397b368 100644 --- a/src/main/java/org/traccar/session/cache/CacheManager.java +++ b/src/main/java/org/traccar/session/cache/CacheManager.java @@ -132,7 +132,7 @@ public class CacheManager implements BroadcastInterface { lock.readLock().lock(); var users = deviceLinks.get(deviceId).get(User.class).stream() .collect(Collectors.toUnmodifiableSet()); - return notificationUsers.get(notificationId).stream() + return notificationUsers.getOrDefault(notificationId, new LinkedList<>()).stream() .filter(user -> users.contains(user.getId())) .collect(Collectors.toUnmodifiableList()); } finally { -- cgit v1.2.3