From: James Moger Date: Mon, 3 Feb 2014 16:13:47 +0000 (-0500) Subject: Fix NPE in cookie change detection on login X-Git-Tag: v1.4.0~117 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Ftickets%2F03%2F3%2F1;p=gitblit.git Fix NPE in cookie change detection on login --- diff --git a/src/main/java/com/gitblit/wicket/pages/SessionPage.java b/src/main/java/com/gitblit/wicket/pages/SessionPage.java index 22ae6e2e..8065c5aa 100644 --- a/src/main/java/com/gitblit/wicket/pages/SessionPage.java +++ b/src/main/java/com/gitblit/wicket/pages/SessionPage.java @@ -57,7 +57,7 @@ public abstract class SessionPage extends WebPage { UserModel user = app().users().getUserModel(session.getUser().username); // validate cookie during session (issue-361) - if (app().settings().getBoolean(Keys.web.allowCookieAuthentication, true)) { + if (user != null && app().settings().getBoolean(Keys.web.allowCookieAuthentication, true)) { HttpServletRequest request = ((WebRequest) getRequestCycle().getRequest()) .getHttpServletRequest(); String requestCookie = app().authentication().getCookie(request);