diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-08-25 19:30:34 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-08-25 19:30:34 +0200 |
commit | b990b22a4d82a6da5b37afbd356b1755c1230364 (patch) | |
tree | b925cf226ca7604e33b8bc5484d2239100d78743 /lib/Travel/Routing | |
parent | 07c5f706b3b924f12132a477556d097bc83da499 (diff) |
add_message: handle messages where code or text are undef
Diffstat (limited to 'lib/Travel/Routing')
-rw-r--r-- | lib/Travel/Routing/DE/HAFAS.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Travel/Routing/DE/HAFAS.pm b/lib/Travel/Routing/DE/HAFAS.pm index 53fbb46..584a3a3 100644 --- a/lib/Travel/Routing/DE/HAFAS.pm +++ b/lib/Travel/Routing/DE/HAFAS.pm @@ -425,7 +425,15 @@ sub add_message { } for my $message ( @{ $self->{messages} } ) { - if ( $code eq $message->{code} and $text eq $message->{text} ) { + if ( + ( + not( not defined $code or not defined $message->{code} ) + or $code eq $message->{code} + ) + and ( not( not defined $text or not defined $message->{text} ) + or $text eq $message->{text} ) + ) + { $message->{ref_count}++; return $message; } |