]> git.donarmstrong.com Git - perltidy.git/commitdiff
check for undefined arg to parse_args
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 25 Feb 2022 03:22:26 +0000 (19:22 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 25 Feb 2022 03:22:26 +0000 (19:22 -0800)
lib/Perl/Tidy.pm

index a97b7aad43603081bbf509ae4c19ea88806828a5..61efa37b87a1a377306debc2e038756b679ea1cb 100644 (file)
@@ -4226,6 +4226,11 @@ sub parse_args {
     my $quote_char = "";
     my $part       = "";
     my $msg        = "";
+
+    # Check for external call with undefined $body - added to fix
+    # github issue Perl-Tidy-Sweetened issue #23
+    if ( !defined($body) ) { $body = "" }
+
     while (1) {
 
         # looking for ending quote character