[Fixed] select group crash

This commit is contained in:
Skyxim 2022-01-21 22:38:02 +08:00
parent b15344ec78
commit daf83eb6f7
2 changed files with 5 additions and 5 deletions

View file

@ -100,7 +100,6 @@ func (s *Selector) selectedProxy(touch bool) C.Proxy {
} }
func NewSelector(option *GroupCommonOption, providers []provider.ProxyProvider) *Selector { func NewSelector(option *GroupCommonOption, providers []provider.ProxyProvider) *Selector {
selected := providers[0].Proxies()[0].Name()
return &Selector{ return &Selector{
Base: outbound.NewBase(outbound.BaseOption{ Base: outbound.NewBase(outbound.BaseOption{
Name: option.Name, Name: option.Name,
@ -110,7 +109,7 @@ func NewSelector(option *GroupCommonOption, providers []provider.ProxyProvider)
}), }),
single: singledo.NewSingle(defaultGetProxiesDuration), single: singledo.NewSingle(defaultGetProxiesDuration),
providers: providers, providers: providers,
selected: selected, selected: "COMPATIBLE",
disableUDP: option.DisableUDP, disableUDP: option.DisableUDP,
filter: option.Filter, filter: option.Filter,
} }

View file

@ -2,7 +2,6 @@ package executor
import ( import (
"fmt" "fmt"
"github.com/Dreamacro/clash/listener/tproxy"
"net" "net"
"os" "os"
"runtime" "runtime"
@ -10,6 +9,8 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/Dreamacro/clash/listener/tproxy"
"github.com/Dreamacro/clash/adapter" "github.com/Dreamacro/clash/adapter"
"github.com/Dreamacro/clash/adapter/outboundgroup" "github.com/Dreamacro/clash/adapter/outboundgroup"
"github.com/Dreamacro/clash/component/auth" "github.com/Dreamacro/clash/component/auth"
@ -75,7 +76,6 @@ func ApplyConfig(cfg *config.Config, force bool) {
updateUsers(cfg.Users) updateUsers(cfg.Users)
updateHosts(cfg.Hosts) updateHosts(cfg.Hosts)
updateProfile(cfg)
updateProxies(cfg.Proxies, cfg.Providers) updateProxies(cfg.Proxies, cfg.Providers)
updateRules(cfg.Rules, cfg.RuleProviders) updateRules(cfg.Rules, cfg.RuleProviders)
updateIPTables(cfg.DNS, cfg.General, cfg.Tun) updateIPTables(cfg.DNS, cfg.General, cfg.Tun)
@ -83,8 +83,9 @@ func ApplyConfig(cfg *config.Config, force bool) {
updateGeneral(cfg.General, cfg.Tun, force) updateGeneral(cfg.General, cfg.Tun, force)
updateTun(cfg.Tun) updateTun(cfg.Tun)
updateExperimental(cfg) updateExperimental(cfg)
loadProvider(cfg.RuleProviders, cfg.Providers) loadProvider(cfg.RuleProviders, cfg.Providers)
updateProfile(cfg)
} }
func GetGeneral() *config.General { func GetGeneral() *config.General {