You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ma...@apache.org on 2020/01/28 13:12:25 UTC

[servicecomb-service-center] branch master updated: Fix the bug that startup fails when the configuration is incomplete

This is an automated email from the ASF dual-hosted git repository.

mabin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new 85dc71b  Fix the bug that startup fails when the configuration is incomplete
85dc71b is described below

commit 85dc71bdc30cb3a226170b99c98e8e3df6cc5c78
Author: chinx <c5...@126.com>
AuthorDate: Thu Dec 26 16:20:38 2019 +0800

    Fix the bug that startup fails when the configuration is incomplete
---
 syncer/config/config.go | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/syncer/config/config.go b/syncer/config/config.go
index 969e6d7..35a27ea 100644
--- a/syncer/config/config.go
+++ b/syncer/config/config.go
@@ -125,8 +125,13 @@ func LoadConfig(filepath string) (*Config, error) {
 
 // Merge other configuration into the current configuration
 func (c *Config) Merge(other *Config) {
-	c.TLSConfig.Merge(syncerName, other.TLSConfig)
-	c.SC.TLSConfig.Merge(servicecenterName, other.SC.TLSConfig)
+	if c.TLSConfig != nil && other.TLSConfig != nil {
+		c.TLSConfig.Merge(syncerName, other.TLSConfig)
+	}
+
+	if c.SC != nil && c.SC.TLSConfig != nil && other.SC != nil && other.SC.TLSConfig != nil {
+		c.SC.TLSConfig.Merge(servicecenterName, other.SC.TLSConfig)
+	}
 }
 
 // Verify Provide config verification