avoid uninitialised value warnings

master
Joey Hess 2008-07-06 17:35:50 -04:00
parent 17fdb8028b
commit 788c1e9eca
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ sub formbuilder_setup (@) { #{{{
my $form=$params{form}; my $form=$params{form};
my $q=$params{cgi}; my $q=$params{cgi};
if ($form->field("do") eq "edit") { if (defined $form->field("do") && $form->field("do") eq "edit") {
$form->field(name => 'attachment', type => 'file'); $form->field(name => 'attachment', type => 'file');
# These buttons are not put in the usual place, so # These buttons are not put in the usual place, so
# are not added to the normal formbuilder button list. # are not added to the normal formbuilder button list.
@ -76,7 +76,7 @@ sub formbuilder (@) { #{{{
my $form=$params{form}; my $form=$params{form};
my $q=$params{cgi}; my $q=$params{cgi};
return if $form->field("do") ne "edit"; return if ! defined $form->field("do") || $form->field("do") ne "edit";
my $filename=$q->param('attachment'); my $filename=$q->param('attachment');
if (defined $filename && length $filename && if (defined $filename && length $filename &&