From 4cac53c54a0452c562560121b93e7c94185924a9 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Sun, 25 Aug 2024 13:09:21 -0400 Subject: [PATCH] OpenWeatherMap: Fix "wego 0" functionality (#175) Same thing as 10d6ea5d73591e784bf8a21bf8e42baa090f0a9e --- backends/openweathermap.org.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backends/openweathermap.org.go b/backends/openweathermap.org.go index d887013..2ca55db 100644 --- a/backends/openweathermap.org.go +++ b/backends/openweathermap.org.go @@ -251,6 +251,10 @@ func (c *openWeatherConfig) Fetch(location string, numdays int) iface.Data { if err != nil { log.Fatalf("Failed to fetch weather data: %v\n", err) } + + if numdays == 0 { + return ret + } ret.Forecast = c.parseDaily(resp.List, numdays) return ret }