diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/web/server/model/DataServiceImpl.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index eb466694..c2ebce15 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -108,7 +108,11 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService private User getSessionUser() { HttpSession session = getThreadLocalRequest().getSession(); - return (User) session.getAttribute(ATTRIBUTE_USER); + User user = (User) session.getAttribute(ATTRIBUTE_USER); + if (user == null) { + throw new IllegalStateException(); + } + return user; } @Override |