Check for null before setting maxSubscribers
The `DirectChannel` doesn't check a result of the `getIntegrationProperty()`. This may cause NPE problem with unconditional `setMaxSubscribers(int)` call. * Check `Integer max` for `null` before propagating to the `setMaxSubscribers()`
This commit is contained in:
@@ -87,7 +87,9 @@ public class DirectChannel extends AbstractSubscribableChannel {
|
||||
super.onInit();
|
||||
if (this.maxSubscribers == null) {
|
||||
Integer max = getIntegrationProperty(IntegrationProperties.CHANNELS_MAX_UNICAST_SUBSCRIBERS, Integer.class);
|
||||
setMaxSubscribers(max);
|
||||
if (max != null) {
|
||||
setMaxSubscribers(max);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user