fix: fatal if protocol.s5 is not set

This commit is contained in:
Derrick Hammer 2024-01-12 09:30:23 -05:00
parent 4819bf45ac
commit de407b2803
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 8 additions and 5 deletions

View File

@ -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 == "" {