You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by be...@apache.org on 2006/04/20 09:52:56 UTC

svn commit: r395525 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java

Author: bernt
Date: Thu Apr 20 00:52:53 2006
New Revision: 395525

URL: http://svn.apache.org/viewcvs?rev=395525&view=rev
Log:
DERBY-1174 NullPointerException in network server with LDAP authentication
Submitted by Anders Morken

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java?rev=395525&r1=395524&r2=395525&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java Thu Apr 20 00:52:53 2006
@@ -97,16 +97,19 @@
 
 		//
 		// We retrieve JNDI properties set at the database level	
-		// if any.
+		// if any. If dbProps == null, there are obviously no database
+		// properties to retrieve.
 		//
 		initDirContextEnv = new Properties();
+                
+		if(dbProps != null) {
+			for (Enumeration keys = dbProps.propertyNames(); keys.hasMoreElements(); ) {
 
-		for (Enumeration keys = dbProps.propertyNames(); keys.hasMoreElements(); ) {
+				String key = (String) keys.nextElement();
 
-			String key = (String) keys.nextElement();
-
-			if (key.startsWith("java.naming.")) {
-				initDirContextEnv.put(key, dbProps.getProperty(key));
+				if (key.startsWith("java.naming.")) {
+					initDirContextEnv.put(key, dbProps.getProperty(key));
+				}
 			}
 		}
 	}