]> source.dussan.org Git - archiva.git/commitdiff
[MNG-1106] guard against NPE which can be generated by the LDAP user manager if misco...
authorBrett Porter <brett@apache.org>
Fri, 6 Mar 2009 16:08:12 +0000 (16:08 +0000)
committerBrett Porter <brett@apache.org>
Fri, 6 Mar 2009 16:08:12 +0000 (16:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@750953 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaServletAuthenticator.java
archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/DefaultUserRepositories.java

index 11d39592d06e1ea40915cf8f562786a1ab5c223a..1b533d30fb0b4c01667241c9b92ea900a88d783c 100644 (file)
@@ -105,6 +105,10 @@ public class ArchivaServletAuthenticator
             }
             
             User user = securitySystem.getUserManager().findUser( principal );
+            if ( user == null )
+            {
+                throw new UnauthorizedException( "The security system had an internal error - please check your system logs" );
+            }
             if ( user.isLocked() )
             {
                 throw new UnauthorizedException( "User account is locked." );
index 842a5e64766728934b82c86f6d8ab0e8bfef0e89..d99b089326f6ae481ce7bea7fd743049f32452ff 100644 (file)
@@ -77,6 +77,10 @@ public class DefaultUserRepositories
         try
         {
             User user = securitySystem.getUserManager().findUser( principal );
+            if ( user == null )
+            {
+                throw new ArchivaSecurityException( "The security system had an internal error - please check your system logs" );
+            }
 
             if ( user.isLocked() )
             {
@@ -145,6 +149,10 @@ public class DefaultUserRepositories
         try
         {
             User user = securitySystem.getUserManager().findUser( principal );
+            if ( user == null )
+            {
+                throw new ArchivaSecurityException( "The security system had an internal error - please check your system logs" );
+            }
 
             if ( user.isLocked() )
             {