cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject [cxf] branch 3.1.x-fixes updated: [CXF-7740]add NPE guard for SAAJStreamWriter
Date Wed, 16 May 2018 09:35:09 GMT
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
     new cda1503  [CXF-7740]add NPE guard for SAAJStreamWriter
cda1503 is described below

commit cda1503096c453043d43df32cd62e882718476c5
Author: Freeman Fang <freeman.fang@gmail.com>
AuthorDate: Wed May 16 17:33:51 2018 +0800

    [CXF-7740]add NPE guard for SAAJStreamWriter
    
    (cherry picked from commit 071aae5b948f233c9202dbfa90444afeea116037)
---
 .../java/org/apache/cxf/binding/soap/saaj/SAAJStreamWriter.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJStreamWriter.java
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJStreamWriter.java
index 8c13b1e..847d04c 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJStreamWriter.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJStreamWriter.java
@@ -134,8 +134,13 @@ public final class SAAJStreamWriter extends OverlayW3CDOMStreamWriter
{
                     setChild(adjustPrefix(getEnvelope(), prefix), false);
                     adjustPrefix(getEnvelope().getHeader(), prefix);
                     adjustPrefix(getEnvelope().getBody(), prefix);
-                    getEnvelope().removeChild(getEnvelope().getHeader());
-                    getEnvelope().removeChild(getEnvelope().getBody());
+                    if (getEnvelope().getHeader() != null) {
+                        getEnvelope().removeChild(getEnvelope().getHeader());
+                    }
+                    if (getEnvelope().getBody() != null) {
+                        getEnvelope().removeChild(getEnvelope().getBody());
+                    }
+
                     return;
                 } else if ("Body".equals(local)) {
                     if (getEnvelope().getBody() == null) {

-- 
To stop receiving notification emails like this one, please contact
ffang@apache.org.

Mime
View raw message