Skip to content

Commit

Permalink
Fix: crash when authenticator is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Jun 27, 2019
1 parent 1c792b4 commit 53528f8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hub/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,22 @@ func ApplyConfig(cfg *config.Config, force bool) {

func GetGeneral() *config.General {
ports := P.GetPorts()
return &config.General{
authenticator := []string{}
if auth := authStore.Authenticator(); auth != nil {
authenticator = auth.Users()
}

general := &config.General{
Port: ports.Port,
SocksPort: ports.SocksPort,
RedirPort: ports.RedirPort,
Authentication: authStore.Authenticator().Users(),
Authentication: authenticator,
AllowLan: P.AllowLan(),
Mode: T.Instance().Mode(),
LogLevel: log.Level(),
}

return general
}

func updateExperimental(c *config.Experimental) {
Expand Down

0 comments on commit 53528f8

Please sign in to comment.