summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-11-28 19:56:14 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-11-28 19:56:14 +0100
commita1174bdba1e09476649eafba3e82f4c7e68c9d4a (patch)
tree7add6661708a2206cb720922a2614733c0bb3d7f
parentd110ce1d7db8a1b91476f686492cb4e7bdf361a3 (diff)
marudor: do not request auslastung if there's not next_station
-rw-r--r--lib/DBInfoscreen/Helper/Marudor.pm5
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(