From f8da1a32a542cee0103f1c905a30e6cc0a18490a Mon Sep 17 00:00:00 2001 From: "Paul B. Henson" Date: Sat, 23 Aug 2025 21:11:45 -0700 Subject: [PATCH] Fix parameter check in BeginList function This fixes two issues with a check in BeginList; first, it accessed a parameter without checking it if existed first, resulting in undefined value warnings; and second it tested the validity of the uppercase version of the parameter but then used the literal parameter in the assignment. --- macros/ui/unionLists.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/ui/unionLists.pl b/macros/ui/unionLists.pl index 4ba214cd88..5189253dd4 100644 --- a/macros/ui/unionLists.pl +++ b/macros/ui/unionLists.pl @@ -54,7 +54,7 @@ =head1 unionLists.pl sub BeginList { my $LIST = 'OL'; - $LIST = shift if (uc($_[0]) eq "OL" or uc($_[0]) eq "UL"); + $LIST = uc(shift) if (defined($_[0]) && (uc($_[0]) eq "OL" or uc($_[0]) eq "UL")); my $enum = ($LIST eq 'OL' ? "enumerate" : "itemize"); my %options = @_; $LIST .= ' TYPE="' . $options{type} . '"' if defined($options{type});