cxf-commits mailing list archives

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

ffang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 071aae5  [CXF-7740]add NPE guard for SAAJStreamWriter
071aae5 is described below

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

    [CXF-7740]add NPE guard for SAAJStreamWriter
---
 .../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 64fe247..1dced4b 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
@@ -133,8 +133,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