]> source.dussan.org Git - gitblit.git/commitdiff
Fix NPE in cookie change detection on login 03/3/1
authorJames Moger <james.moger@gitblit.com>
Mon, 3 Feb 2014 16:13:47 +0000 (11:13 -0500)
committerJames Moger <james.moger@gitblit.com>
Mon, 3 Feb 2014 16:13:47 +0000 (11:13 -0500)
src/main/java/com/gitblit/wicket/pages/SessionPage.java

index 22ae6e2ea242974103a4372da67e93a06f8314e2..8065c5aa72af5c7e420116b4480daab106704bf5 100644 (file)
@@ -57,7 +57,7 @@ public abstract class SessionPage extends WebPage {
                        UserModel user = app().users().getUserModel(session.getUser().username);\r
 \r
                        // validate cookie during session (issue-361)\r
-                       if (app().settings().getBoolean(Keys.web.allowCookieAuthentication, true)) {\r
+                       if (user != null && app().settings().getBoolean(Keys.web.allowCookieAuthentication, true)) {\r
                                HttpServletRequest request = ((WebRequest) getRequestCycle().getRequest())\r
                                                .getHttpServletRequest();\r
                                String requestCookie = app().authentication().getCookie(request);\r