From 1f5489c0188dd3e063b9e226891f0fce662ee4b4 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 12 Jan 2013 14:35:50 +1300 Subject: Fix null pointer exception with 0 devices --- src/org/traccar/web/server/model/DataServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index fa7a42d8..a1ea80be 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -193,7 +193,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService public List getLatestPositions() { List positions = new LinkedList(); User user = getUser(); - if (!user.getDevices().isEmpty()) { + if (user.getDevices() != null && !user.getDevices().isEmpty()) { TypedQuery query = entityManager.createQuery( "SELECT x FROM Position x WHERE x.id IN (" + "SELECT y.latestPosition FROM Device y WHERE y IN (:devices))", Position.class); -- cgit v1.2.3