Committer: wisest-owl
LJSUP-13663: Error appeares when you try to add a giftU trunk/htdocs/admin/vgift/edit.bml
Modified: trunk/htdocs/admin/vgift/edit.bml =================================================================== --- trunk/htdocs/admin/vgift/edit.bml 2012-09-14 14:04:08 UTC (rev 12652) +++ trunk/htdocs/admin/vgift/edit.bml 2012-09-17 09:19:33 UTC (rev 12653) @@ -33,12 +33,18 @@ #BML::parse_multipart(\%POST, \$error, 999992048); #warn "ERROR: $error" and return $error if $error; my $large_file = LJ::Request->upload('vgift_content_large'); - seek $large_file->fh, 0,0; - read $large_file->fh, my $large_file_content, $large_file->size; + my $large_file_content = ''; + if ($large_file) { + seek $large_file->fh, 0,0; + read $large_file->fh, $large_file_content, $large_file->size; + } my $small_file = LJ::Request->upload('vgift_content_small'); - seek $small_file->fh, 0,0; - read $small_file->fh, my $small_file_content, $small_file->size; + my $small_file_content = ''; + if ($small_file) { + seek $small_file->fh, 0,0; + read $small_file->fh, $small_file_content, $small_file->size; + } my $vgift;