From f4d33a6dfecd4b738731049b1fd9f53890a6c85f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 18 May 2020 14:54:01 +0200 Subject: [PATCH] Consistent not-null assertions for configured interceptors Closes gh-25089 --- .../messaging/support/AbstractMessageChannel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }