summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-12-30 11:46:06 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-12-30 11:46:06 +0100
commitc32169bcb3cc5cb6a89af3aad32c8ac3c160ed64 (patch)
treed1da9acda0450c817486c7d5f01388af232c3586 /lib/Travel
parent457ea50fc0cedbfde502de7ecb1923e17d28e940 (diff)
mot_mask: skip unknown mot types
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm8
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} );
+ }
}
}