You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/06/13 07:04:41 UTC

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

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