aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-01-12 14:35:50 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-01-12 14:35:50 +1300
commit1f5489c0188dd3e063b9e226891f0fce662ee4b4 (patch)
treea6074e4538ba8c832f9fe6dd62a9d80e65a81df2 /src
parent9f60706d957a183433cd61de9e422e565a1f15d4 (diff)
downloadetbsa-traccar-web-1f5489c0188dd3e063b9e226891f0fce662ee4b4.tar.gz
etbsa-traccar-web-1f5489c0188dd3e063b9e226891f0fce662ee4b4.tar.bz2
etbsa-traccar-web-1f5489c0188dd3e063b9e226891f0fce662ee4b4.zip
Fix null pointer exception with 0 devices
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/web/server/model/DataServiceImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java
index fa7a42d..a1ea80b 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<Position> getLatestPositions() {
List<Position> positions = new LinkedList<Position>();
User user = getUser();
- if (!user.getDevices().isEmpty()) {
+ if (user.getDevices() != null && !user.getDevices().isEmpty()) {
TypedQuery<Position> query = entityManager.createQuery(
"SELECT x FROM Position x WHERE x.id IN (" +
"SELECT y.latestPosition FROM Device y WHERE y IN (:devices))", Position.class);