You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/12/09 15:35:17 UTC
[camel] branch camel-3.0.x updated: [CAMEL-14277] NPE when NATS
server not configured
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.0.x by this push:
new 49b21c4 [CAMEL-14277] NPE when NATS server not configured
49b21c4 is described below
commit 49b21c438a670ff4e895c600443dca1e80e6e6d3
Author: Thomas Diesler <td...@redhat.com>
AuthorDate: Mon Dec 9 15:32:55 2019 +0100
[CAMEL-14277] NPE when NATS server not configured
---
.../java/org/apache/camel/component/nats/NatsConfiguration.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
index d046a8f..55f189c 100644
--- a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
+++ b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConfiguration.java
@@ -27,6 +27,7 @@ import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;
import org.apache.camel.spi.UriPath;
import org.apache.camel.support.jsse.SSLContextParameters;
+import org.apache.camel.util.ObjectHelper;
@UriParams
public class NatsConfiguration {
@@ -360,7 +361,10 @@ public class NatsConfiguration {
StringBuilder servers = new StringBuilder();
String prefix = "nats://";
- String[] pieces = getServers().split(",");
+ String srvspec = getServers();
+ ObjectHelper.notNull(srvspec, "No servers configured");
+
+ String[] pieces = srvspec.split(",");
for (int i = 0; i < pieces.length; i++) {
if (i < pieces.length - 1) {
servers.append(prefix + pieces[i] + ",");