From 23a612ee5e987695b1d4e33f8ecb2bcf4d0038e9 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Sun, 15 Sep 2024 22:39:18 +0200 Subject: [PATCH] fix(weather_status): Fix search address errors when offline Signed-off-by: provokateurin --- apps/weather_status/lib/Service/WeatherStatusService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/weather_status/lib/Service/WeatherStatusService.php b/apps/weather_status/lib/Service/WeatherStatusService.php index da0ee855e857d..005b9b4df2fd8 100644 --- a/apps/weather_status/lib/Service/WeatherStatusService.php +++ b/apps/weather_status/lib/Service/WeatherStatusService.php @@ -257,6 +257,9 @@ private function searchForAddress(string $address): array { ]; $url = 'https://nominatim.openstreetmap.org/search'; $results = $this->requestJSON($url, $params); + if ($results['error'] !== null) { + return $results; + } if (count($results) > 0) { return $results[0]; }