fix: exclude-filter not work when filter is empty

This commit is contained in:
gVisor bot 2022-11-09 08:41:30 +08:00
parent a3d4385a90
commit b1802da5ea

View File

@ -71,20 +71,15 @@ func (gb *GroupBase) Touch() {
}
func (gb *GroupBase) GetProxies(touch bool) []C.Proxy {
if len(gb.filterRegs) == 0 {
var proxies []C.Proxy
if len(gb.filterRegs) == 0 {
for _, pd := range gb.providers {
if touch {
pd.Touch()
}
proxies = append(proxies, pd.Proxies()...)
}
if len(proxies) == 0 {
return append(proxies, tunnel.Proxies()["COMPATIBLE"])
}
return proxies
}
} else {
for i, pd := range gb.providers {
if touch {
pd.Touch()
@ -121,10 +116,10 @@ func (gb *GroupBase) GetProxies(touch bool) []C.Proxy {
}
}
var proxies []C.Proxy
for _, p := range gb.proxies {
proxies = append(proxies, p...)
}
}
if len(proxies) == 0 {
return append(proxies, tunnel.Proxies()["COMPATIBLE"])