Commit 786142b7 by Tuomas Riihimäki

Fix http session wrapping. Check for nulls

1 parent ac491ba8
...@@ -154,10 +154,16 @@ public class HttpSessionWrapper implements HttpSession ...@@ -154,10 +154,16 @@ public class HttpSessionWrapper implements HttpSession
} }
public static List<HttpSessionWrapper> wrap(Set<HttpSession> sessions, SessionMgmtBeanLocal sessionMgmt) { public static List<HttpSessionWrapper> wrap(Set<HttpSession> sessions, SessionMgmtBeanLocal sessionMgmt) {
ArrayList<HttpSessionWrapper> ret = new ArrayList<>(); List<HttpSessionWrapper> ret = new ArrayList<>();
for (HttpSession s : sessions) { for (HttpSession s : sessions) {
UserContainer uc = sessionMgmt.getUsername(s.getId()); UserContainer uc = sessionMgmt.getUsername(s.getId());
ret.add(new HttpSessionWrapper(s, uc.getUsername(), uc.getHostname())); String username = null;
String hostname = null;
if (uc != null) {
username = uc.getUsername();
hostname = uc.getHostname();
}
ret.add(new HttpSessionWrapper(s, username, hostname));
} }
Collections.sort(ret, new LastSeenComparator()); Collections.sort(ret, new LastSeenComparator());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!