commit | 73186d388f8c2132a112d8dd39f229baf7ced8ba | [log] [tgz] |
---|---|---|
author | Joe Schaefer <joes@apache.org> | Sat Apr 16 20:46:59 2005 +0000 |
committer | Joe Schaefer <joes@apache.org> | Sat Apr 16 20:46:59 2005 +0000 |
tree | 76c5296e0b073fccc652e69d3c56734b11409122 | |
parent | c5b9bb7076d93ae41f2238fd85056377bad9fcca [diff] |
Empty bodies should yield an empty return. git-svn-id: https://svn.apache.org/repos/asf/httpd/apreq/branches/multi-env-unstable@161604 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/glue/perl/lib/Apache2/Upload.pm b/glue/perl/lib/Apache2/Upload.pm index c64b16b..6d9e147 100644 --- a/glue/perl/lib/Apache2/Upload.pm +++ b/glue/perl/lib/Apache2/Upload.pm
@@ -7,11 +7,10 @@ } sub Apache2::Request::upload { my $req = shift; - my $body = $req->body; + my $body = $req->body or return; $body->param_class(__PACKAGE__); - my @uploads; if (@_) { - @uploads = grep $_->upload, $body->get(@_); + my @uploads = grep $_->upload, $body->get(@_); return wantarray ? @uploads : $uploads[0]; }