From 0ff4df2ac9fbbadde296a3ac7f79095416b60745 Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 3 Feb 2014 11:13:47 -0500 Subject: [PATCH] Fix NPE in cookie change detection on login --- src/main/java/com/gitblit/wicket/pages/SessionPage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5