diff options
author | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-17 19:05:07 +0000 |
---|---|---|
committer | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-17 19:05:07 +0000 |
commit | fea5aad7bb340cb654ae8011130065ac18cf061a (patch) | |
tree | 30cc5fd401920f11853e963cd48243b5f426bbca /java | |
parent | d48dbb1534c172e3c8d068707bc54a1c0aff7167 (diff) |
Fix NPE in finally after earlier exception.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@696399 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-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); |