This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
     new f65acda  CXF-7787 - NullPointerException from wsdl2java
f65acda is described below

commit f65acda229b1c6fee61767d274989d385adf5395
Author: Colm O hEigeartaigh <cohei...@apache.org>
AuthorDate: Thu Jul 12 12:38:33 2018 +0100

    CXF-7787 - NullPointerException from wsdl2java
    
    (cherry picked from commit 203ca92cc4ba73afa4ee49f8086452bc3ca06916)
    (cherry picked from commit ffad68e5c2b7eed392b538f585665c6a0c959446)
---
 .../main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/core/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java 
b/core/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
index a9b6a1c..ad3a248 100644
--- a/core/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
+++ b/core/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
@@ -161,7 +161,8 @@ public class SchemaCollection {
      */
     public XmlSchema getSchemaByTargetNamespace(String namespaceURI) {
         for (XmlSchema schema : schemaCollection.getXmlSchemas()) {
-            if (namespaceURI.equals(schema.getTargetNamespace())) {
+            if (namespaceURI != null && 
namespaceURI.equals(schema.getTargetNamespace())
+                || namespaceURI == null && schema.getTargetNamespace() == 
null) {
                 return schema;
             }
         }

Reply via email to