This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/3.6.x-fixes by this push:
     new f3f2f26530 Added null check to DataWriterImpl when calling 
getLastMTOMElementName (#2416)
f3f2f26530 is described below

commit f3f2f265302133206a5d02f2bc99549caf5b7c63
Author: jspr-schlz <[email protected]>
AuthorDate: Tue May 20 17:17:21 2025 +0200

    Added null check to DataWriterImpl when calling getLastMTOMElementName 
(#2416)
    
    (cherry picked from commit 27deb8899755420557066ab9c3f6840ac5e1cbf0)
    (cherry picked from commit 5b891e8d2834178f05daae8fcc86eaeb9f8bb43f)
---
 .../jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java 
b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
index c7de57f3cd..921c4976f8 100644
--- 
a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
+++ 
b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/io/DataWriterImpl.java
@@ -102,7 +102,8 @@ public class DataWriterImpl<T> extends JAXBDataBase 
implements DataWriter<T> {
             // CXF-1194/CXF-7438 this hack is specific to MTOM, so pretty safe 
to leave in
             // here before calling the origHandler.
             String msg = event.getMessage();
-            if ((msg.startsWith("cvc-type.3.1.2") || 
msg.startsWith("cvc-complex-type.2.2"))
+            if (marshaller.getLastMTOMElementName() != null
+                && (msg.startsWith("cvc-type.3.1.2") || 
msg.startsWith("cvc-complex-type.2.2"))
                 && 
msg.contains(marshaller.getLastMTOMElementName().getLocalPart())) {
                 return true;
             }

Reply via email to