Author: mrglavas
Date: Sat Dec 13 21:04:10 2008
New Revision: 726359

URL: http://svn.apache.org/viewvc?rev=726359&view=rev
Log:
Fixing JIRA Issue #1348:
http://issues.apache.org/jira/browse/XERCESJ-1348

itemByName() could fail with an NPE. We need to check that 
the SymbolHash returned a non-null value before checking 
whether the type categories match.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XSNamedMap4Types.java

Modified: 
xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XSNamedMap4Types.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XSNamedMap4Types.java?rev=726359&r1=726358&r2=726359&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XSNamedMap4Types.java 
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/util/XSNamedMap4Types.java 
Sat Dec 13 21:04:10 2008
@@ -108,7 +108,7 @@
             if (isEqual(namespace, fNamespaces[i])) {
                 XSTypeDefinition type = 
(XSTypeDefinition)fMaps[i].get(localName);
                 // only return it if it matches the required type
-                if (type.getTypeCategory() == fType) {
+                if (type != null && type.getTypeCategory() == fType) {
                     return type;
                 }
                 return null;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to