diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm index 6cbaf11..e0f4706 100644 --- a/lib/Travelynx/Helper/HAFAS.pm +++ b/lib/Travelynx/Helper/HAFAS.pm @@ -86,9 +86,10 @@ sub get_departures_p { my ( $self, %opt ) = @_; my $when - = ( $opt{timestamp}->clone - // DateTime->now( time_zone => 'Europe/Berlin' ) ) - ->subtract( minutes => $opt{lookbehind} ); + = $opt{timestamp} + ? $opt{timestamp}->clone + : DateTime->now( time_zone => 'Europe/Berlin' ); + ->subtract( minutes => $opt{lookbehind} ); return Travel::Status::DE::HAFAS->new_p( station => $opt{eva}, datetime => $when,