From b6870238babbb239a0ef8b62a1c45cab35ce3b87 Mon Sep 17 00:00:00 2001 From: kieran Date: Tue, 21 Apr 2020 00:00:28 +0100 Subject: Ensure item is not null before adding to the collection in getItems method of the BaseObjectManager --- src/main/java/org/traccar/database/BaseObjectManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/traccar/database/BaseObjectManager.java b/src/main/java/org/traccar/database/BaseObjectManager.java index e274e5aba..d0024c005 100644 --- a/src/main/java/org/traccar/database/BaseObjectManager.java +++ b/src/main/java/org/traccar/database/BaseObjectManager.java @@ -158,7 +158,10 @@ public class BaseObjectManager { public final Collection getItems(Set itemIds) { Collection result = new LinkedList<>(); for (long itemId : itemIds) { - result.add(getById(itemId)); + T item = getById(itemId); + if (item != null) { + result.add(item); + } } return result; } -- cgit v1.2.3