Fix guard for unitialized variable

The original guard was preventing an id with value of
zero from being processed correctly.
This commit is contained in:
Roan Horning 2024-10-08 17:37:48 -04:00
parent 39d2ef86ad
commit 8b277607cf
Signed by: rho_n
GPG Key ID: 234AEF20B72D5769

View File

@ -290,11 +290,8 @@ sub parse_page_arg {
# Split page name from page ids if available. # Split page name from page ids if available.
my ($page, $ids) = split(/=/, $page_arg); my ($page, $ids) = split(/=/, $page_arg);
my @ids; my @ids;
$ids = "" unless defined $ids;
if(!$ids) {
$ids = "";
}
else {
# Parse the page ids and push them onto @ids array # Parse the page ids and push them onto @ids array
my @ids_by_comma = split(/\,/, $ids); my @ids_by_comma = split(/\,/, $ids);
foreach my $id_by_comma (@ids_by_comma) { foreach my $id_by_comma (@ids_by_comma) {
@ -309,7 +306,7 @@ sub parse_page_arg {
verbose (1, "\nWarning: Page $page id range $id_by_comma could not be parsed."); verbose (1, "\nWarning: Page $page id range $id_by_comma could not be parsed.");
} }
} }
}
return ('page' => $page, 'ids' => [@ids]); return ('page' => $page, 'ids' => [@ids]);
} }