Skip to content

Commit ee2bc61

Browse files
committed
Protecting Context.bind(..) from a null object parameter (see issue #6). SimpleJNDI currently doesn't support null values, so this matches the current feature set.
1 parent 3fd3ece commit ee2bc61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

simple-jndi/src/java/org/osjava/sj/jndi/AbstractContext.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,14 @@ public Object lookup(String name) throws NamingException {
309309
* @see javax.naming.Context#bind(javax.naming.Name, java.lang.Object)
310310
*/
311311
public void bind(Name name, Object object) throws NamingException {
312+
313+
// See the above XXX; namely we assume that JNDI isn't used to
314+
// store keys. This is here to stop the underlying Hashtable
315+
// barfing.
316+
if (object == null) {
317+
return;
318+
}
319+
312320
/*
313321
* If the name of obj doesn't start with the name of this context,
314322
* it is an error, throw a NamingException

0 commit comments

Comments
 (0)