Author: gdaniels
Date: Mon Aug 25 21:16:05 2008
New Revision: 688956

URL: http://svn.apache.org/viewvc?rev=688956&view=rev
Log:
Protect against potential NPE on headers w/no namespace.  Really, we should be 
complaining about such headers anyway, but this at least stops the NPE.

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderImpl.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderImpl.java?rev=688956&r1=688955&r2=688956&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderImpl.java
 Mon Aug 25 21:16:05 2008
@@ -110,8 +110,11 @@
 
     public boolean checkHeader(SOAPHeaderBlock header) {
         // If we're filtering on namespace, check that first since the compare 
is simpler.
-        if ((namespace != null) && 
!namespace.equals(header.getNamespace().getNamespaceURI())) {
-            return false;
+        if (namespace != null) {
+            OMNamespace headerNamespace = header.getNamespace();
+            if (headerNamespace == null || 
!namespace.equals(headerNamespace.getNamespaceURI())) {
+                return false;
+            }
         }
 
         String role = header.getRole();


Reply via email to