From de407b2803fb7d1321487789b5bbf5a5e0734eeb Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 12 Jan 2024 09:30:23 -0500 Subject: [PATCH] fix: fatal if protocol.s5 is not set --- protocols/s5.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/protocols/s5.go b/protocols/s5.go index 661e546..4fc5cfe 100644 --- a/protocols/s5.go +++ b/protocols/s5.go @@ -43,11 +43,13 @@ func (s *S5Protocol) Initialize(portal interfaces.Portal) error { pconfig := config.Sub("protocol.s5") - if pconfig != nil { - err := pconfig.Unmarshal(cfg) - if err != nil { - return err - } + if pconfig == nil { + logger.Fatal("Missing protocol.s5 config") + } + + err := pconfig.Unmarshal(cfg) + if err != nil { + return err } cfg.HTTP.API.Domain = config.GetString("core.domain") @@ -57,6 +59,7 @@ func (s *S5Protocol) Initialize(portal interfaces.Portal) error { } else { cfg.HTTP.API.Port = config.GetUint("core.port") } + dbPath := pconfig.GetString("dbPath") if dbPath == "" {