db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From be...@apache.org
Subject svn commit: r395525 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
Date Thu, 20 Apr 2006 07:52:56 GMT
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));
+				}
 			}
 		}
 	}



Mime
View raw message