diff --git a/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java index 66333fc2b5..d6eee4dbe5 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,11 +76,13 @@ public abstract class AbstractMessageChannel implements MessageChannel, Intercep @Override public void addInterceptor(ChannelInterceptor interceptor) { + Assert.notNull(interceptor, "ChannelInterceptor must not be null"); this.interceptors.add(interceptor); } @Override public void addInterceptor(int index, ChannelInterceptor interceptor) { + Assert.notNull(interceptor, "ChannelInterceptor must not be null"); this.interceptors.add(index, interceptor); }