We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fec89af commit 2a34c0eCopy full SHA for 2a34c0e
spring-core/src/main/java/org/springframework/core/convert/converter/Converter.java
@@ -57,8 +57,11 @@ public interface Converter<S, T> {
57
* @since 5.3
58
*/
59
default <U> Converter<S, U> andThen(Converter<? super T, ? extends U> after) {
60
- Assert.notNull(after, "after must not be null");
61
- return (S s) -> after.convert(convert(s));
+ Assert.notNull(after, "After Converter must not be null");
+ return (S s) -> {
62
+ T initialResult = convert(s);
63
+ return (initialResult != null ? after.convert(initialResult) : null);
64
+ };
65
}
66
67
0 commit comments