From 3db10bea9e836745d0de9a2298f72ae474bc3fcd Mon Sep 17 00:00:00 2001
From: Mike McKay <mfmckay@wustl.edu>
Date: Sun, 29 May 2016 22:50:14 -0500
Subject: [PATCH] XNAT-4252 Prevented user from getting error page when logging
 out of an open XNAT.

---
 .../java/org/nrg/xnat/security/XnatLogoutHandler.java     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/nrg/xnat/security/XnatLogoutHandler.java b/src/main/java/org/nrg/xnat/security/XnatLogoutHandler.java
index e1e2f0c4..e51fd586 100644
--- a/src/main/java/org/nrg/xnat/security/XnatLogoutHandler.java
+++ b/src/main/java/org/nrg/xnat/security/XnatLogoutHandler.java
@@ -26,9 +26,11 @@ public class XnatLogoutHandler extends SecurityContextLogoutHandler implements L
         super.logout(request, response, authentication);
 
         //expire that guy here.
-        SessionInformation si = _registry.getSessionInformation(request.getSession().getId());
-        if (si!=null) {
-            si.expireNow();
+        if(_registry!=null) {
+            SessionInformation si = _registry.getSessionInformation(request.getSession().getId());
+            if (si != null) {
+                si.expireNow();
+            }
         }
 
     }
-- 
GitLab