Remove impossible nil check in handler

This commit is contained in:
lash 2024-09-05 15:28:53 +01:00
parent 2bf7a5c246
commit 6fa5f49bc0
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 7 additions and 5 deletions

@ -1 +1 @@
Subproject commit 1f47a674d95380be8c387f410f0342eb72357df5 Subproject commit 326bdb5018ae81ee493371b56bd4564a8b35da59

View File

@ -17,12 +17,14 @@ import (
"git.defalsify.org/vise.git/persist" "git.defalsify.org/vise.git/persist"
"git.defalsify.org/vise.git/resource" "git.defalsify.org/vise.git/resource"
"git.defalsify.org/vise.git/state" "git.defalsify.org/vise.git/state"
"git.defalsify.org/vise.git/logging"
"git.grassecon.net/urdt/ussd/internal/handlers/server" "git.grassecon.net/urdt/ussd/internal/handlers/server"
"git.grassecon.net/urdt/ussd/internal/utils" "git.grassecon.net/urdt/ussd/internal/utils"
"gopkg.in/leonelquinteros/gotext.v1" "gopkg.in/leonelquinteros/gotext.v1"
) )
var ( var (
logg = logging.NewVanilla().WithDomain("ussdmenuhandler")
scriptDir = path.Join("services", "registration") scriptDir = path.Join("services", "registration")
translationDir = path.Join(scriptDir, "locale") translationDir = path.Join(scriptDir, "locale")
) )
@ -98,10 +100,10 @@ func NewHandlers(appFlags *asm.FlagParser, pe *persist.Persister, userdataStore
accountFileHandler: utils.NewAccountFileHandler(userdataStore), accountFileHandler: utils.NewAccountFileHandler(userdataStore),
accountService: &server.AccountService{}, accountService: &server.AccountService{},
} }
if h.st == nil || h.ca == nil || h.userdataStore == nil || h.flagManager == nil { // if h.st == nil || h.ca == nil || h.userdataStore == nil || h.flagManager == nil {
//logg.Errorf("have nil for essential value in handler", "state", h.st, "cache", h.ca, "store", h.userdataStore, "flags", h.flagManager) // logg.Errorf("have nil for essential value in handler", "state", h.st, "cache", h.ca, "store", h.userdataStore, "flags", h.flagManager)
return nil, fmt.Errorf("have nil for essential value") // return nil, fmt.Errorf("have nil for essential value")
} // }
return h, nil return h, nil
} }