From: James Moger Date: Fri, 18 Apr 2014 02:53:33 +0000 (-0400) Subject: [findbugs] Add null check when testing if a user is disabled in SessionPage X-Git-Tag: v1.5.0~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=68fb1791fa8033d464d50e45481d04c3e3d0a025;p=gitblit.git [findbugs] Add null check when testing if a user is disabled in SessionPage --- diff --git a/src/main/java/com/gitblit/wicket/pages/SessionPage.java b/src/main/java/com/gitblit/wicket/pages/SessionPage.java index 909342ae..7a58175f 100644 --- a/src/main/java/com/gitblit/wicket/pages/SessionPage.java +++ b/src/main/java/com/gitblit/wicket/pages/SessionPage.java @@ -56,8 +56,8 @@ public abstract class SessionPage extends WebPage { // any changes to permissions or roles (issue-186) UserModel user = app().users().getUserModel(session.getUser().username); - if (user.disabled) { - // user was disabled during session + if (user == null || user.disabled) { + // user was deleted/disabled during session HttpServletResponse response = ((WebResponse) getRequestCycle().getResponse()) .getHttpServletResponse(); app().authentication().logout(response, user);