]> source.dussan.org Git - archiva.git/commitdiff
NPE free and fix find user with only ldap
authorOlivier Lamy <olamy@apache.org>
Wed, 9 Jan 2013 00:05:50 +0000 (00:05 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 9 Jan 2013 00:05:50 +0000 (00:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1430639 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaConfigurableUsersManager.java

index cd599fa516ee39fd4d16adcb38eb35d8abf75374..9b0535572cfe3cf5680802a2147ff676ccc4fb91 100644 (file)
@@ -84,7 +84,7 @@ public class ArchivaAuthorizer
                     authorizationException = e;
                 }
 
-                if ( result.isAuthorized() )
+                if ( result != null && result.isAuthorized() )
                 {
                     return result;
                 }
index a87a4c4334885745784f5b88be67b6dc7b0cf71c..853b14d1529633e0d661d0f2a1d26c02b36aeac8 100644 (file)
@@ -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;