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

alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git


The following commit(s) were added to refs/heads/develop by this push:
     new 84affcae fix nil pointer (#517)
84affcae is described below

commit 84affcae0f3d24de022d31f1faffe8630c421d84
Author: nicktming <[email protected]>
AuthorDate: Sun Nov 6 21:31:54 2022 +0800

    fix nil pointer (#517)
---
 pixiu/pkg/config/config_load.go      | 6 ++++--
 pixiu/pkg/filter/http/remote/call.go | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pixiu/pkg/config/config_load.go b/pixiu/pkg/config/config_load.go
index 94780286..80aa01bc 100644
--- a/pixiu/pkg/config/config_load.go
+++ b/pixiu/pkg/config/config_load.go
@@ -202,8 +202,10 @@ func (m *ConfigManager) LoadBootConfig(path string) 
*model.Bootstrap {
        // load file
        configs = m.loadLocalBootConfigs(path)
 
-       if strings.EqualFold(m.localConfig.Config.Enable, "true") {
-               configs = m.loadRemoteBootConfigs()
+       if m.localConfig != nil && m.localConfig.Config != nil {
+               if strings.EqualFold(m.localConfig.Config.Enable, "true") {
+                       configs = m.loadRemoteBootConfigs()
+               }
        }
 
        config = configs
diff --git a/pixiu/pkg/filter/http/remote/call.go 
b/pixiu/pkg/filter/http/remote/call.go
index ecb29fc8..fb05b3ce 100644
--- a/pixiu/pkg/filter/http/remote/call.go
+++ b/pixiu/pkg/filter/http/remote/call.go
@@ -115,7 +115,7 @@ func (factory *FilterFactory) PrepareFilterChain(ctx 
*contexthttp.HttpContext, c
 }
 
 func (f *Filter) Decode(c *contexthttp.HttpContext) filter.FilterStatus {
-       if f.conf.Dpc.AutoResolve {
+       if f.conf.Dpc != nil && f.conf.Dpc.AutoResolve {
                if err := f.resolve(c); err != nil {
                        c.SendLocalReply(http.StatusInternalServerError, 
[]byte(fmt.Sprintf("auto resolve err: %s", err)))
                        return filter.Stop

Reply via email to