diff --git a/spring-core/src/main/java/org/springframework/core/convert/converter/Converter.java b/spring-core/src/main/java/org/springframework/core/convert/converter/Converter.java index e089081c5d0..c1bc0d2131d 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/converter/Converter.java +++ b/spring-core/src/main/java/org/springframework/core/convert/converter/Converter.java @@ -57,8 +57,11 @@ public interface Converter { * @since 5.3 */ default Converter andThen(Converter after) { - Assert.notNull(after, "after must not be null"); - return (S s) -> after.convert(convert(s)); + Assert.notNull(after, "After Converter must not be null"); + return (S s) -> { + T initialResult = convert(s); + return (initialResult != null ? after.convert(initialResult) : null); + }; } }