]> source.dussan.org Git - gitblit.git/commitdiff
[findbugs] Add null check when testing if a user is disabled in SessionPage
authorJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 02:53:33 +0000 (22:53 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 18 Apr 2014 03:08:07 +0000 (23:08 -0400)
src/main/java/com/gitblit/wicket/pages/SessionPage.java

index 909342aeef84367074f884d24145416732f78b9e..7a58175fe05ea003903760a1a41b78f2228b98cb 100644 (file)
@@ -56,8 +56,8 @@ public abstract class SessionPage extends WebPage {
                        // any changes to permissions or roles (issue-186)\r
                        UserModel user = app().users().getUserModel(session.getUser().username);\r
 \r
-                       if (user.disabled) {\r
-                               // user was disabled during session\r
+                       if (user == null || user.disabled) {\r
+                               // user was deleted/disabled during session\r
                                HttpServletResponse response = ((WebResponse) getRequestCycle().getResponse())\r
                                                .getHttpServletResponse();\r
                                app().authentication().logout(response, user);\r