GH-60: Fix NPE in KinesisMessageDrivenChAdapter

Fixes: spring-projects/spring-integration-aws#60

The attempts to extract `this.consumerInvokers.get(0)` when the `concurrency == 0` lead to the NPE

* Wrap `this.consumerInvokers.get(0)` block to the `if(concurrency != 0)`
This commit is contained in:
Artem Bilan
2017-03-28 14:51:42 -04:00
parent 8d1839980b
commit 041290dbb8

View File

@@ -552,9 +552,11 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport i
}
}
ConsumerInvoker firstConsumerInvoker = this.consumerInvokers.get(0);
firstConsumerInvoker.addConsumer(shardConsumer);
this.consumerInvokerMaxCapacity = firstConsumerInvoker.consumers.size();
if (this.concurrency != 0) {
ConsumerInvoker firstConsumerInvoker = this.consumerInvokers.get(0);
firstConsumerInvoker.addConsumer(shardConsumer);
this.consumerInvokerMaxCapacity = firstConsumerInvoker.consumers.size();
}
}
}
}