From c6fee690ab391be746b9fc10bbd074f5b22bb537 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 1 Feb 2017 12:14:36 -0700 Subject: [PATCH] Only configure ServiceDiscovery if null rather than not null. fixes gh-111 --- .../cloud/zookeeper/discovery/ZookeeperServiceDiscovery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/ZookeeperServiceDiscovery.java b/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/ZookeeperServiceDiscovery.java index a98fb598..a7233196 100644 --- a/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/ZookeeperServiceDiscovery.java +++ b/spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/ZookeeperServiceDiscovery.java @@ -120,7 +120,7 @@ public class ZookeeperServiceDiscovery implements ZookeeperRegistration, Applica configureServiceInstance(this.serviceInstance, this.appName, this.context, this.port, host, uriSpec); } - if (this.serviceDiscovery.get() != null) { + if (this.serviceDiscovery.get() == null) { configureServiceDiscovery(this.serviceDiscovery, this.curator, this.properties, this.instanceSerializer, this.serviceInstance); }