summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorscottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68>2008-09-17 19:05:07 +0000
committerscottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68>2008-09-17 19:05:07 +0000
commitfea5aad7bb340cb654ae8011130065ac18cf061a (patch)
tree30cc5fd401920f11853e963cd48243b5f426bbca /java
parentd48dbb1534c172e3c8d068707bc54a1c0aff7167 (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.java4
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);