Skip to content

Commit bfe28db

Browse files
committed
Revert NPE check in the AbstMappingMessageRouter
1 parent 990294b commit bfe28db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMappingMessageRouter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,14 @@ else if (channelKey instanceof String[]) {
312312
else if (channelKey instanceof Collection) {
313313
addToCollection(channels, (Collection<?>) channelKey, message);
314314
}
315-
else if (getRequiredConversionService().canConvert(channelKey.getClass(), String.class)) {
315+
else if (channelKey != null &&
316+
getRequiredConversionService().canConvert(channelKey.getClass(), String.class)) {
316317
String converted = getConversionService().convert(channelKey, String.class);
317318
if (converted != null) {
318319
addChannelFromString(channels, converted, message);
319320
}
320321
}
321-
else {
322+
else if (channelKey != null) {
322323
throw new MessagingException("unsupported return type for router [" + channelKey.getClass() + "]");
323324
}
324325
}

0 commit comments

Comments
 (0)