summaryrefslogtreecommitdiff
path: root/pkg/vpn
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-04-27 16:02:42 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-05-04 14:58:39 +0200
commit0bf00f54b4478192d976c06af07f8183a8052233 (patch)
treec176ebac7f0fd92dbbe802a566d1bfd2bc37a048 /pkg/vpn
parenta7b197e623aa3412a9acaa6c0e7b4ca27cd706b6 (diff)
[bug] fix init crash
Diffstat (limited to 'pkg/vpn')
-rw-r--r--pkg/vpn/bonafide/gateways.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/vpn/bonafide/gateways.go b/pkg/vpn/bonafide/gateways.go
index 50359e9..d8f12ec 100644
--- a/pkg/vpn/bonafide/gateways.go
+++ b/pkg/vpn/bonafide/gateways.go
@@ -92,6 +92,9 @@ func (p *gatewayPool) isValidLocation(location string) bool {
func (p *gatewayPool) listLocationFullness(transport string) map[string]float64 {
locations := p.getLocations()
cm := make(map[string]float64)
+ if len(locations) == 0 {
+ return cm
+ }
if len(p.recommended) != 0 {
for _, gw := range p.recommended {
if _, ok := cm[gw.gateway.Location]; ok {