Commit 55e1afe3 authored by Olivier Salaün's avatar Olivier Salaün
Browse files

Fix errors 'Can't use an undefined value as an ARRAY reference' while running...

Fix errors 'Can't use an undefined value as an ARRAY reference' while running sympa.pl --modify_list. Check if  and  before trying to print their content
parent c34ea0d3
......@@ -987,15 +987,19 @@ elsif ($main::options{'modify_list'}) {
"\n************************************************************\n";
unless (defined $result->{'ok'}) {
printf STDERR "\n%s\n", join("\n", @{$result->{'string_info'}});
print STDERR "\nThe action has been stopped because of error :\n";
printf STDERR "\n%s\n", join("\n", @{$result->{'string_error'}});
if (defined $result->{'string_error'} && (ref($result->{'string_error'}) eq 'ARRAY')) {
printf STDERR "\n%s\n", join("\n", @{$result->{'string_error'}});
}
exit 1;
}
close INFILE;
printf STDOUT "\n%s\n", join("\n", @{$result->{'string_info'}});
if (defined $result->{'string_info'} && (ref($result->{'string_info'}) eq 'ARRAY')) {
printf STDOUT "\n%s\n", join("\n", @{$result->{'string_info'}});
}
exit 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment