Selaa lähdekoodia

Exclude empty string from available regions

Adam Pritchard 11 vuotta sitten
vanhempi
sitoutus
55a860afdb
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6 1
      psiphon/dataStore.go

+ 6 - 1
psiphon/dataStore.go

@@ -545,7 +545,12 @@ func ReportAvailableRegions() {
 			NoticeAlert("failed to retrieve available regions from data store: %s", ContextError(err))
 			return
 		}
-		regions = append(regions, region)
+
+		// Some server entries do not have a region, but it makes no sense to return
+		// an empty string as an "available region".
+		if (region != "") {
+			regions = append(regions, region)
+		}
 	}
 
 	NoticeAvailableEgressRegions(regions)