diff options
author | Dave Arter <davea@mysociety.org> | 2015-07-27 16:00:32 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-07-27 16:00:32 +0100 |
commit | e30fda319976d871d3d28a0b749f2834b24ccde2 (patch) | |
tree | 37273b362037b9e35e5a637f06d2b0fbb9c35323 /perllib/FixMyStreet/App.pm | |
parent | 7842b439b87287db8d74048829e6bb57f7b009ec (diff) |
Make sure get_param_list returns empty list if param is missing
If the specified parameter was missing from `$c->req->params`, a list
of form `(undef)` would be returned. This commit makes it return an
empty list if the parameter is missing.
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 866f1f462..787755a05 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -560,7 +560,8 @@ sub get_param_list { my ($c, $param) = @_; my $value = $c->req->params->{$param}; return @$value if ref $value; - return ($value); + return ($value) if defined $value; + return (); } =head2 set_param |