summaryrefslogtreecommitdiff
path: root/lib/Travel/Routing/DE/HAFAS.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-08-25 19:30:34 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-08-25 19:30:34 +0200
commitb990b22a4d82a6da5b37afbd356b1755c1230364 (patch)
treeb925cf226ca7604e33b8bc5484d2239100d78743 /lib/Travel/Routing/DE/HAFAS.pm
parent07c5f706b3b924f12132a477556d097bc83da499 (diff)
add_message: handle messages where code or text are undef
Diffstat (limited to 'lib/Travel/Routing/DE/HAFAS.pm')
-rw-r--r--lib/Travel/Routing/DE/HAFAS.pm10
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;
}