changeset 1506:a693f487d860

deal with list of roles being null.
author robcast
date Thu, 28 Apr 2016 19:07:49 +0200
parents a8022963fac5
children 8c7f1ef5a67f
files servlet/src/main/java/digilib/auth/OpenIdAuthnOps.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/servlet/src/main/java/digilib/auth/OpenIdAuthnOps.java	Thu Apr 28 18:15:52 2016 +0200
+++ b/servlet/src/main/java/digilib/auth/OpenIdAuthnOps.java	Thu Apr 28 19:07:49 2016 +0200
@@ -216,7 +216,10 @@
     @Override
     public boolean isUserInRole(DigilibRequest request, String role) throws AuthOpException {
         List<String> provided = getUserRoles(request);
-        return provided.contains(role);
+        if (provided != null && provided.contains(role)) {
+            return true;
+        }
+        return false;
     }
 
 }