You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ba...@apache.org on 2007/10/29 21:57:11 UTC

svn commit: r589855 - /webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchema.java

Author: barrettj
Date: Mon Oct 29 13:57:11 2007
New Revision: 589855

URL: http://svn.apache.org/viewvc?rev=589855&view=rev
Log:
Added NPE guard.  The schema reference may be null, so check it is not before using it to get an element.  The original code was added under revision 587375. 
This NPE was encountered by Axis2 ADB-Codegen tests.

Modified:
    webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchema.java

Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchema.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchema.java?rev=589855&r1=589854&r2=589855&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchema.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchema.java Mon Oct 29 13:57:11 2007
@@ -149,7 +149,7 @@
                     //skip ?
                     continue;
                 }
-                if (schema.getElementByName(name) != null) {
+                if (schema != null && schema.getElementByName(name) != null) {
                     return schema.getElementByName(name);
                 }
             }
@@ -176,7 +176,7 @@
                     continue;
                 }
 
-                if (schema.getTypeByName(name) != null) {
+                if (schema != null && schema.getTypeByName(name) != null) {
                     return schema.getTypeByName(name);
                 }
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org