From c32169bcb3cc5cb6a89af3aad32c8ac3c160ed64 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 30 Dec 2023 11:46:06 +0100 Subject: mot_mask: skip unknown mot types --- lib/Travel/Status/DE/HAFAS.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index c360150..39339f7 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -515,13 +515,17 @@ sub mot_mask { if ( my @mots = @{ $self->{exclusive_mots} // [] } ) { $mot_mask = 0; for my $mot (@mots) { - $mot_mask |= 1 << $mot_pos{$mot}; + if ( exists $mot_pos{$mot} ) { + $mot_mask |= 1 << $mot_pos{$mot}; + } } } if ( my @mots = @{ $self->{excluded_mots} // [] } ) { for my $mot (@mots) { - $mot_mask &= ~( 1 << $mot_pos{$mot} ); + if ( exists $mot_pos{$mot} ) { + $mot_mask &= ~( 1 << $mot_pos{$mot} ); + } } } -- cgit v1.2.3