directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r190351 - /directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/jndi/AbstractContextFactory.java
Date Mon, 13 Jun 2005 05:04:41 GMT
Author: trustin
Date: Sun Jun 12 22:04:41 2005
New Revision: 190351

URL: http://svn.apache.org/viewcvs?rev=190351&view=rev
Log:
Fixed: NullPointerException

Modified:
    directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/jndi/AbstractContextFactory.java

Modified: directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/jndi/AbstractContextFactory.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/jndi/AbstractContextFactory.java?rev=190351&r1=190350&r2=190351&view=diff
==============================================================================
--- directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/jndi/AbstractContextFactory.java
(original)
+++ directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/jndi/AbstractContextFactory.java
Sun Jun 12 22:04:41 2005
@@ -81,10 +81,26 @@
         else if( cfg instanceof StartupConfiguration )
         {
             // fire up the backend subsystem if we need to
-            username = env.remove( Context.SECURITY_PRINCIPAL ).toString();
-            password = env.remove( Context.SECURITY_CREDENTIALS ).toString();
+            Object value = env.remove( Context.SECURITY_PRINCIPAL );
+            if( value == null )
+            {
+                value = "";
+            }
+            username = value.toString();
+            
+            value = env.remove( Context.SECURITY_CREDENTIALS );
+            if( value == null )
+            {
+                value = "";
+            }
+            password = value.toString();
 
-            providerUrl = env.remove( Context.PROVIDER_URL ).toString();
+            value = env.remove( Context.PROVIDER_URL );
+            if( value == null )
+            {
+                value = "";
+            }
+            providerUrl = value.toString();
             ( ( DefaultContextFactoryContext ) provider ).startup( this, env );
         }
         else



Mime
View raw message