diff --git a/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OAuthOverOpenIDLogoutServlet.java b/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OAuthOverOpenIDLogoutServlet.java index 9dbff03102..02f428e62d 100644 --- a/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OAuthOverOpenIDLogoutServlet.java +++ b/gerrit-openid/src/main/java/com/google/gerrit/httpd/auth/openid/OAuthOverOpenIDLogoutServlet.java @@ -50,6 +50,8 @@ class OAuthOverOpenIDLogoutServlet extends HttpLogoutServlet { protected void doLogout(HttpServletRequest req, HttpServletResponse rsp) throws IOException { super.doLogout(req, rsp); - oauthSession.get().logout(); + if (req.getSession(false) != null) { + oauthSession.get().logout(); + } } }