summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-12-01 20:34:11 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-12-01 20:34:11 +0100
commit88227899bce6ad89478479d64fcc7a84b5a29eed (patch)
tree02f7cbf3acd1c8250ed8aca82d5b93b2a5940a74 /lib
parent37db8fb09d309e67baf14bcae0c7caf640d1a0c6 (diff)
Operators: gracefully handle missing adminIDs
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Operators.pm.PL9
1 files changed, 9 insertions, 0 deletions
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];
}