From 88227899bce6ad89478479d64fcc7a84b5a29eed Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 1 Dec 2025 20:34:11 +0100 Subject: Operators: gracefully handle missing adminIDs --- lib/Travel/Status/DE/DBRIS/Operators.pm.PL | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/Travel/Status/DE/DBRIS/Operators.pm.PL b/lib/Travel/Status/DE/DBRIS/Operators.pm.PL index 03a3546..da81e07 100644 --- a/lib/Travel/Status/DE/DBRIS/Operators.pm.PL +++ b/lib/Travel/Status/DE/DBRIS/Operators.pm.PL @@ -41,11 +41,17 @@ $buf .= <<'EOF'; sub get_operator { my ($id) = @_; + if (not defined $id) { + return; + } return $admin_id_to_operator{$id}; } sub get_operator_abbr { my ($id) = @_; + if (not defined $id) { + return; + } if (my $op = $admin_id_to_operator{$id}) { return $op->[0]; } @@ -54,6 +60,9 @@ sub get_operator_abbr { sub get_operator_name { my ($id) = @_; + if (not defined $id) { + return; + } if (my $op = $admin_id_to_operator{$id}) { return $op->[1]; } -- cgit v1.2.3