cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r1243620 - /cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
Date Mon, 13 Feb 2012 17:49:31 GMT
Author: asoldano
Date: Mon Feb 13 17:49:31 2012
New Revision: 1243620

URL: http://svn.apache.org/viewvc?rev=1243620&view=rev
Log:
[CXF-4103] Prevent NPE

Modified:
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java?rev=1243620&r1=1243619&r2=1243620&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java (original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetUtils.java Mon
Feb 13 17:49:31 2012
@@ -575,12 +575,14 @@ public class WSDLGetUtils {
     }
 
     private String findSchemaLocation(Map<String, SchemaReference> doneSchemas, SchemaReference
imp) {
-        for (Map.Entry<String, SchemaReference> e : doneSchemas.entrySet()) {
-            if (e.getValue().getReferencedSchema().getElement() 
-                == imp.getReferencedSchema().getElement()) {
-                doneSchemas.put(imp.getSchemaLocationURI(), imp);
-                imp.setSchemaLocationURI(e.getKey());
-                return e.getKey();
+        if (imp.getReferencedSchema() != null) {
+            for (Map.Entry<String, SchemaReference> e : doneSchemas.entrySet()) {
+                if (e.getValue().getReferencedSchema().getElement() 
+                    == imp.getReferencedSchema().getElement()) {
+                    doneSchemas.put(imp.getSchemaLocationURI(), imp);
+                    imp.setSchemaLocationURI(e.getKey());
+                    return e.getKey();
+                }
             }
         }
         return imp.getSchemaLocationURI();



Mime
View raw message