Fix: crash when authenticator is nil
This commit is contained in:
parent
1c792b46c9
commit
53528f8275
@ -35,15 +35,22 @@ func ApplyConfig(cfg *config.Config, force bool) {
|
|||||||
|
|
||||||
func GetGeneral() *config.General {
|
func GetGeneral() *config.General {
|
||||||
ports := P.GetPorts()
|
ports := P.GetPorts()
|
||||||
return &config.General{
|
authenticator := []string{}
|
||||||
|
if auth := authStore.Authenticator(); auth != nil {
|
||||||
|
authenticator = auth.Users()
|
||||||
|
}
|
||||||
|
|
||||||
|
general := &config.General{
|
||||||
Port: ports.Port,
|
Port: ports.Port,
|
||||||
SocksPort: ports.SocksPort,
|
SocksPort: ports.SocksPort,
|
||||||
RedirPort: ports.RedirPort,
|
RedirPort: ports.RedirPort,
|
||||||
Authentication: authStore.Authenticator().Users(),
|
Authentication: authenticator,
|
||||||
AllowLan: P.AllowLan(),
|
AllowLan: P.AllowLan(),
|
||||||
Mode: T.Instance().Mode(),
|
Mode: T.Instance().Mode(),
|
||||||
LogLevel: log.Level(),
|
LogLevel: log.Level(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return general
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateExperimental(c *config.Experimental) {
|
func updateExperimental(c *config.Experimental) {
|
||||||
|
Reference in New Issue
Block a user