Added npe guard; fixes gh-1154

This commit is contained in:
Marcin Grzejszczak
2019-09-17 17:17:45 +02:00
parent de94a14a9a
commit 876be130ed

View File

@@ -76,7 +76,7 @@ public class CamelStubMessages implements MessageVerifier<Message> {
ConsumerTemplate consumerTemplate = this.context.createConsumerTemplate();
Exchange exchange = consumerTemplate.receive(destination,
timeUnit.toMillis(timeout));
return exchange.getIn();
return exchange != null ? exchange.getIn() : null;
}
catch (Exception e) {
log.error("Exception occurred while trying to read a message from "