aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hugh...@apache.org
Subject svn commit: r1624519 - /aries/trunk/jndi/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java
Date Fri, 12 Sep 2014 12:30:06 GMT
Author: hughesj
Date: Fri Sep 12 12:30:06 2014
New Revision: 1624519

URL: http://svn.apache.org/r1624519
Log:
ARIES-1243: Fixed NPE caused by null env passed to OSGiObjectFactoryBuilder.getObjectInstance()

Modified:
    aries/trunk/jndi/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java

Modified: aries/trunk/jndi/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java
URL: http://svn.apache.org/viewvc/aries/trunk/jndi/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java?rev=1624519&r1=1624518&r2=1624519&view=diff
==============================================================================
--- aries/trunk/jndi/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java
(original)
+++ aries/trunk/jndi/jndi-core/src/main/java/org/apache/aries/jndi/OSGiObjectFactoryBuilder.java
Fri Sep 12 12:30:06 2014
@@ -49,6 +49,11 @@ public class OSGiObjectFactoryBuilder im
                                     Name name,
                                     Context nameCtx,
                                     Hashtable<?, ?> environment) throws Exception {
+        
+        if (environment == null) {
+            environment = new Hashtable();
+        }
+        
         BundleContext callerContext = getCallerBundleContext(environment);
         if (callerContext == null) {
             return obj;
@@ -62,6 +67,11 @@ public class OSGiObjectFactoryBuilder im
                                     Context nameCtx,
                                     Hashtable<?, ?> environment,
                                     Attributes attrs) throws Exception {
+        
+        if (environment == null) {
+            environment = new Hashtable();
+        }
+        
         BundleContext callerContext = getCallerBundleContext(environment);
         if (callerContext == null) {
             return obj;



Mime
View raw message