summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-01-05 11:32:48 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-01-05 11:32:48 +0100
commitdeccb957cf6db4d69be796c11d5c724dc47c6b48 (patch)
tree5ca893522a23aa5274af30c4c15827f12ca0a42a
parent06e65334b39b210c367256d128df5de9e1b29425 (diff)
Do not parse uninitialized values
-rw-r--r--lib/DBInfoscreen/Controller/Map.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/DBInfoscreen/Controller/Map.pm b/lib/DBInfoscreen/Controller/Map.pm
index e85dfcb..6530309 100644
--- a/lib/DBInfoscreen/Controller/Map.pm
+++ b/lib/DBInfoscreen/Controller/Map.pm
@@ -18,8 +18,6 @@ sub get_hafas_polyline_p {
my $cache = $self->app->cache_iris_main;
my $promise = Mojo::Promise->new;
- say $url;
-
if ( my $content = $cache->thaw($url) ) {
$promise->resolve($content);
return $promise;
@@ -146,15 +144,19 @@ sub route {
with_map => 1,
origin => {
name => $pl->{raw}{origin}{name},
- ts => $strp->parse_datetime( $pl->{raw}{departure} ),
+ ts => $pl->{raw}{dep_line}
+ ? scalar $strp->parse_datetime( $pl->{raw}{departure} )
+ : undef,
},
destination => {
name => $pl->{raw}{destination}{name},
- ts => $strp->parse_datetime( $pl->{raw}{arrival} ),
+ ts => $pl->{raw}{arrival}
+ ? scalar $strp->parse_datetime( $pl->{raw}{arrival} )
+ : undef,
},
polyline_groups => [
{
- polylines => \@line_pairs,
+ polylines => [@line_pairs],
color => '#00838f',
opacity => 0.6,
fit_bounds => 1,