diff options
Diffstat (limited to 'java/sca/modules/databinding-jaxb-axiom')
-rw-r--r-- | java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java b/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java index 827a1684bc..3753fd9d64 100644 --- a/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java +++ b/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java @@ -62,7 +62,9 @@ public class OMElement2JAXB extends BaseTransformer<OMElement, Object> implement reader = source.getXMLStreamReaderWithoutCaching(); result = unmarshaller.unmarshal(reader, JAXBContextHelper.getJavaType(context.getTargetDataType())); } finally { - reader.close(); + if (reader != null) { + reader.close(); + } JAXBContextHelper.releaseJAXBUnmarshaller(jaxbContext, unmarshaller); } return JAXBContextHelper.createReturnValue(jaxbContext, context.getTargetDataType(), result); |