summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}