Commit f8afc769 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Stations: Short-circuit when receiving an invalid station name/code

This avoids thousands of "uninitialized value" warnings
parent dd99f577
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -80,6 +80,10 @@ sub normalize {
sub get_station {
	my ($name) = @_;

	if (not $name) {
		return;
	}

	my $ds100_match = firstval { $name eq $_->[0] } @stations;

	if ($ds100_match) {
@@ -125,6 +129,10 @@ sub get_station_by_location {
sub get_station_by_name {
	my ($name) = @_;

	if (not $name) {
		return;
	}

	my $nname        = lc($name);
	my $actual_match = firstval { $nname eq lc( $_->[1] ) } @stations;