Fix clobbering of RuntimeExc with null causing later NPE
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@679644 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a68dee0727
commit
56ecac6977
1 changed files with 6 additions and 4 deletions
|
@ -96,12 +96,14 @@ public class DataTransformationInterceptor implements Interceptor, DataExchangeS
|
|||
Object transformedFault = null;
|
||||
if ((result instanceof Exception) && !(result instanceof RuntimeException)) {
|
||||
transformedFault = faultTransformHelper.transformFault(result, sourceOperation, targetOperation, wire);
|
||||
if (transformedFault != result) {
|
||||
resultMsg.setFaultBody(transformedFault);
|
||||
}
|
||||
}
|
||||
// Otherwise, we leave it to another layer to actually throw the RuntimeException which constitutes
|
||||
//
|
||||
// Leave it to another layer to actually throw the Exception which constitutes
|
||||
// the message body. We don't throw it here.
|
||||
if (transformedFault != result) {
|
||||
resultMsg.setFaultBody(transformedFault);
|
||||
}
|
||||
//
|
||||
} else {
|
||||
assert !(result instanceof Throwable) : "Expected messages that are not throwable " + result;
|
||||
Object newResult = transform(result, targetType, sourceType, true);
|
||||
|
|
Loading…
Reference in a new issue