Skip to content

Commit

Permalink
fix: should not access nssf context before assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
yccodr committed May 9, 2024
1 parent 6d27b3a commit 8a74e48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ type NssfApp struct {
var _ app.NssfApp = &NssfApp{}

func NewApp(cfg *factory.Config, tlsKeyLogPath string) (*NssfApp, error) {
nssf := &NssfApp{cfg: cfg, wg: sync.WaitGroup{}}
nssf_context.Init()

nssf := &NssfApp{cfg: cfg, wg: sync.WaitGroup{}, nssfCtx: nssf_context.GetSelf()}
nssf.SetLogEnable(cfg.GetLogEnable())
nssf.SetLogLevel(cfg.GetLogLevel())
nssf.SetReportCaller(cfg.GetLogReportCaller())
Expand All @@ -52,8 +54,6 @@ func NewApp(cfg *factory.Config, tlsKeyLogPath string) (*NssfApp, error) {
sbiServer := sbi.NewServer(nssf, tlsKeyLogPath)
nssf.sbiServer = sbiServer

nssf_context.Init()
nssf.nssfCtx = nssf_context.GetSelf()
return nssf, nil
}

Expand Down

0 comments on commit 8a74e48

Please sign in to comment.