mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 09:05:30 +00:00
Var changes, mor robustness against inputs
This commit is contained in:
@@ -196,7 +196,9 @@ func (p *GeonamesProvider) FetchPlaces(places []GeonamesData) {
|
||||
}
|
||||
|
||||
func (p *GeonamesProvider) fetchPlace(ID, GeonamesURL string) {
|
||||
SPLITURL := strings.Split(GeonamesURL, "/")
|
||||
// Remove trailing slash if present
|
||||
cleanURL := strings.TrimSuffix(GeonamesURL, "/")
|
||||
SPLITURL := strings.Split(cleanURL, "/")
|
||||
if len(SPLITURL) < 2 {
|
||||
logging.Error(nil, "Error parsing Geonames ID from: "+GeonamesURL)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user