diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-30 11:46:06 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-30 11:46:06 +0100 |
commit | c32169bcb3cc5cb6a89af3aad32c8ac3c160ed64 (patch) | |
tree | d1da9acda0450c817486c7d5f01388af232c3586 /lib/Travel/Status | |
parent | 457ea50fc0cedbfde502de7ecb1923e17d28e940 (diff) |
mot_mask: skip unknown mot types
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS.pm | 8 |
1 files changed, 6 insertions, 2 deletions
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} ); + } } } |