Skip to content

Commit f4d33a6

Browse files
committed
Consistent not-null assertions for configured interceptors
Closes spring-projectsgh-25089
1 parent 4798da0 commit f4d33a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -76,11 +76,13 @@ public void setInterceptors(List<ChannelInterceptor> interceptors) {
7676

7777
@Override
7878
public void addInterceptor(ChannelInterceptor interceptor) {
79+
Assert.notNull(interceptor, "ChannelInterceptor must not be null");
7980
this.interceptors.add(interceptor);
8081
}
8182

8283
@Override
8384
public void addInterceptor(int index, ChannelInterceptor interceptor) {
85+
Assert.notNull(interceptor, "ChannelInterceptor must not be null");
8486
this.interceptors.add(index, interceptor);
8587
}
8688

0 commit comments

Comments
 (0)