From 0bf00f54b4478192d976c06af07f8183a8052233 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Tue, 27 Apr 2021 16:02:42 +0200 Subject: [bug] fix init crash --- pkg/vpn/bonafide/gateways.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/vpn') 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 { -- cgit v1.2.3