From 3b986c952c5add17284bf759577afec3b2545eb1 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 ed416d09a87f2..0ecac2ea57b6a 100644 --- a/apps/weather_status/lib/Service/WeatherStatusService.php +++ b/apps/weather_status/lib/Service/WeatherStatusService.php @@ -275,6 +275,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]; }