From 9c8b82fb6e84d12b58fe87e4a8b12e0888d9c323 Mon Sep 17 00:00:00 2001 From: Fabian Vogler Date: Thu, 10 Oct 2024 20:49:14 +0200 Subject: [PATCH] Check for stop in timetable.search.ch response --- lib/Transport/API.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Transport/API.php b/lib/Transport/API.php index 6e9c555..1c48a68 100644 --- a/lib/Transport/API.php +++ b/lib/Transport/API.php @@ -170,13 +170,12 @@ public function getStationBoard(StationBoardQuery $query) // send request $result = $this->sendAndParseQuery($query); - // check for API messages - if (isset($result->messages) && is_array($result->messages)) { - throw new \Exception('Messages from timetable.search.ch: '.implode($result->messages)); + if (isset($result->stop)) { + $station = Station::createStationFromJson($result->stop); + } else { + $station = null; } - $station = Station::createStationFromJson($result->stop); - $journeys = []; if ($result->connections) {