cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/2] git commit: [CXF-6010] Fix potential NPE Patch from Eirik Bjorsnos applied
Date Tue, 07 Oct 2014 14:52:07 GMT
[CXF-6010] Fix potential NPE
Patch from Eirik Bjorsnos applied


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/745a7840
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/745a7840
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/745a7840

Branch: refs/heads/master
Commit: 745a7840f80f0e6c712b708bf9fb5506b931ac9b
Parents: 04f0ef2
Author: Daniel Kulp <dkulp@apache.org>
Authored: Tue Oct 7 10:24:30 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Tue Oct 7 10:29:53 2014 -0400

----------------------------------------------------------------------
 .../interceptors/MessageModeOutInterceptor.java   | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/745a7840/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
index dd82c9c..815558a 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
@@ -202,16 +202,18 @@ public class MessageModeOutInterceptor extends AbstractPhaseInterceptor<Message>
         }
     }
     private void validateFaultDetail(Element detail, Schema schema, BindingOperationInfo
bop) throws Exception {
-        Element el = DOMUtils.getFirstElement(detail);
-        while (el != null) {
-            QName qn = DOMUtils.getElementQName(el);
-            for (BindingFaultInfo bfi : bop.getFaults()) {
-                if (bfi.getFaultInfo().getMessagePartByIndex(0).getConcreteName().equals(qn))
{
-                    //Found a fault with the correct QName, we can validate it
-                    schema.newValidator().validate(new DOMSource(el));
+        if (detail != null) {
+            Element el = DOMUtils.getFirstElement(detail);
+            while (el != null) {
+                QName qn = DOMUtils.getElementQName(el);
+                for (BindingFaultInfo bfi : bop.getFaults()) {
+                    if (bfi.getFaultInfo().getMessagePartByIndex(0).getConcreteName().equals(qn))
{
+                        //Found a fault with the correct QName, we can validate it
+                        schema.newValidator().validate(new DOMSource(el));
+                    }
                 }
+                el = DOMUtils.getNextElement(el);
             }
-            el = DOMUtils.getNextElement(el);
         }
     }
     private void validateFault(SoapMessage message, SOAPFault fault, BindingOperationInfo
bop) {


Mime
View raw message