hotfix(custom): allow empty servers data
This commit is contained in:
@@ -141,7 +141,7 @@ func getLocationFilterChoices(vpnServiceProvider string, ss *ServerSelection,
|
||||
ispChoices, nameChoices, hostnameChoices []string,
|
||||
err error) {
|
||||
providerServers, ok := allServers.ProviderToServers[vpnServiceProvider]
|
||||
if !ok {
|
||||
if !ok && vpnServiceProvider != providers.Custom {
|
||||
panic(fmt.Sprintf("VPN service provider unknown: %s", vpnServiceProvider))
|
||||
}
|
||||
servers := providerServers.Servers
|
||||
|
||||
@@ -16,6 +16,10 @@ type AllServers struct {
|
||||
}
|
||||
|
||||
func (a *AllServers) ServersSlice(provider string) []Server {
|
||||
if provider == providers.Custom {
|
||||
return nil
|
||||
}
|
||||
|
||||
servers, ok := a.ProviderToServers[provider]
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("provider %s not found in all servers", provider))
|
||||
|
||||
Reference in New Issue
Block a user