From a1174bdba1e09476649eafba3e82f4c7e68c9d4a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 28 Nov 2021 19:56:14 +0100 Subject: marudor: do not request auslastung if there's not next_station --- lib/DBInfoscreen/Helper/Marudor.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/DBInfoscreen') diff --git a/lib/DBInfoscreen/Helper/Marudor.pm b/lib/DBInfoscreen/Helper/Marudor.pm index cdc90f4..f2a58cf 100644 --- a/lib/DBInfoscreen/Helper/Marudor.pm +++ b/lib/DBInfoscreen/Helper/Marudor.pm @@ -139,6 +139,11 @@ sub get_train_utilization { $next_station = $route[0]; } + if ( not $next_station ) { + $promise->reject("train has no next_station"); + return $promise; + } + $self->get_json_p( $self->{realtime_cache}, "https://marudor.de/api/hafas/v2/auslastung/${this_station}/${next_station}/${train_no}/${dep}" )->then( -- cgit v1.2.3