You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/11/29 23:06:55 UTC

svn commit: r1040314 - /cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java

Author: dkulp
Date: Mon Nov 29 22:06:55 2010
New Revision: 1040314

URL: http://svn.apache.org/viewvc?rev=1040314&view=rev
Log:
[CXF-3061] Add an NPE guard

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java?rev=1040314&r1=1040313&r2=1040314&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java Mon Nov 29 22:06:55 2010
@@ -195,17 +195,19 @@ public final class EndpointReferenceUtil
             // handle case where given systemId is null (so that
             // direct key lookup fails) by scanning through map
             // searching for a namespace match
-            for (Map.Entry<String, byte[]> ent : schemas.entrySet()) {
-                if (ent.getKey().endsWith(namespaceURI)) {
-                    schemas.remove(ent.getKey());
-                    impl = new LSInputImpl();
-                    impl.setSystemId(newId);
-                    impl.setBaseURI(newId);
-                    impl.setCharacterStream(
-                        new InputStreamReader(
-                            new ByteArrayInputStream(ent.getValue())));
-                    done.add(newId + ":" + namespaceURI);
-                    return impl;
+            if (namespaceURI != null) {
+                for (Map.Entry<String, byte[]> ent : schemas.entrySet()) {
+                    if (ent.getKey().endsWith(namespaceURI)) {
+                        schemas.remove(ent.getKey());
+                        impl = new LSInputImpl();
+                        impl.setSystemId(newId);
+                        impl.setBaseURI(newId);
+                        impl.setCharacterStream(
+                            new InputStreamReader(
+                                new ByteArrayInputStream(ent.getValue())));
+                        done.add(newId + ":" + namespaceURI);
+                        return impl;
+                    }
                 }
             }