From 7fcb02920d56959f4eb06ca715aa9615e5136bd1 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 9 Jan 2013 00:05:50 +0000 Subject: [PATCH] NPE free and fix find user with only ldap git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1430639 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/archiva/web/security/ArchivaAuthorizer.java | 2 +- .../archiva/web/security/ArchivaConfigurableUsersManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java index cd599fa51..9b0535572 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java @@ -84,7 +84,7 @@ public class ArchivaAuthorizer authorizationException = e; } - if ( result.isAuthorized() ) + if ( result != null && result.isAuthorized() ) { return result; } diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java index a87a4c433..853b14d15 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java @@ -449,7 +449,7 @@ public class ArchivaConfigurableUsersManager throws UserManagerException { UserManager userManager = findFirstWritable(); - if ( userManager.isReadOnly() ) + if ( userManager == null ) { log.warn( "cannot find writable user manager implementation, skip guest user creation" ); return null; -- 2.39.5