directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r771484 - /directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Date Mon, 04 May 2009 22:46:37 GMT
Author: elecharny
Date: Mon May  4 22:46:36 2009
New Revision: 771484

URL: http://svn.apache.org/viewvc?rev=771484&view=rev
Log:
Fixed a NPE for Anonymous bind

Modified:
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java

Modified: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java?rev=771484&r1=771483&r2=771484&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Mon May  4 22:46:36 2009
@@ -271,6 +271,7 @@
             
             if ( writeFuture.getException() != null )
             {
+                writeFuture.getException().printStackTrace();
                 String message = "We have got an exception while writing the request : "
+ 
                     writeFuture.getException().getMessage();
                 LOG.error( message );
@@ -1032,13 +1033,30 @@
         {
             // Simple bind
             authentication = new SimpleAuthentication();
-            ((SimpleAuthentication)authentication).setSimple( bindRequest.getCredentials()
);
+            
+            if ( bindRequest.getCredentials() != null )
+            {
+                ((SimpleAuthentication)authentication).setSimple( bindRequest.getCredentials()
);
+            }
+            else
+            {
+                ((SimpleAuthentication)authentication).setSimple( StringTools.EMPTY_BYTES
);
+            }
         }
         else
         {
             // SASL bind
             authentication = new SaslCredentials();
-            ((SaslCredentials)authentication).setCredentials( bindRequest.getCredentials()
);
+            
+            if ( bindRequest.getCredentials() != null )
+            {
+                ((SaslCredentials)authentication).setCredentials( bindRequest.getCredentials()
);
+            }
+            else
+            {
+                ((SaslCredentials)authentication).setCredentials( StringTools.EMPTY_BYTES
);
+            }
+            
             ((SaslCredentials)authentication).setMechanism( bindRequest.getSaslMechanism()
);
         }
         



Mime
View raw message