cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1040314 - /cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
Date Mon, 29 Nov 2010 22:06:55 GMT
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;
+                    }
                 }
             }
                 



Mime
View raw message