cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r658241 - /cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Date Tue, 20 May 2008 13:31:49 GMT
Author: dkulp
Date: Tue May 20 06:31:49 2008
New Revision: 658241

URL: http://svn.apache.org/viewvc?rev=658241&view=rev
Log:
Guard against NPE when creating a fault

Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?rev=658241&r1=658240&r2=658241&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Tue May 20 06:31:49 2008
@@ -639,8 +639,13 @@
         } catch (Throwable ex) {
             if (ex instanceof javax.xml.bind.UnmarshalException) {
                 javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException)ex;
-                throw new Fault(new Message("UNMARSHAL_ERROR", BUNDLE, unmarshalEx.getLinkedException()
-                    .getMessage()), ex);
+                if (unmarshalEx.getLinkedException() != null) {
+                    throw new Fault(new Message("UNMARSHAL_ERROR", BUNDLE, 
+                                            unmarshalEx.getLinkedException().getMessage()),
ex);
+                } else {
+                    throw new Fault(new Message("UNMARSHAL_ERROR", BUNDLE, 
+                                                unmarshalEx.getMessage()), ex);         
          
+                }
             } else {
                 throw new Fault(new Message("UNMARSHAL_ERROR", BUNDLE, ex.getMessage()),
ex);
             }



Mime
View raw message