From bbd7a12a4ec7e11261dc147b3e1aab34dac04100 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Tue, 5 Aug 2008 19:50:14 +0000 Subject: [PATCH] MethodInvokingSource now returns null when the method invocation result is null. --- .../integration/message/MethodInvokingSource.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingSource.java b/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingSource.java index 42d47f9205..a5dcea3790 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingSource.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingSource.java @@ -60,7 +60,11 @@ public class MethodInvokingSource implements PollableSource, Initializin this.afterPropertiesSet(); } try { - return new GenericMessage(this.invoker.invokeMethod(new Object[] {})); + Object result = this.invoker.invokeMethod(new Object[] {}); + if (result == null) { + return null; + } + return new GenericMessage(result); } catch (InvocationTargetException e) { throw new MessagingException( "Source method '" + this.methodName + "' threw an Exception.", e.getTargetException());