diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-11-28 19:56:14 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-11-28 19:56:14 +0100 |
commit | a1174bdba1e09476649eafba3e82f4c7e68c9d4a (patch) | |
tree | 7add6661708a2206cb720922a2614733c0bb3d7f | |
parent | d110ce1d7db8a1b91476f686492cb4e7bdf361a3 (diff) |
marudor: do not request auslastung if there's not next_station
-rw-r--r-- | lib/DBInfoscreen/Helper/Marudor.pm | 5 |
1 files changed, 5 insertions, 0 deletions
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( |