diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 6 | ||||
-rw-r--r-- | t/app/controller/report_inspect.t | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm index efb770f70..1230bfcae 100644 --- a/perllib/FixMyStreet/App/Controller/My.pm +++ b/perllib/FixMyStreet/App/Controller/My.pm @@ -57,12 +57,12 @@ sub inspector_redirect : Local : Args(0) { my ( $self, $c ) = @_; my $categories = $c->user->categories_string; - my $area_ids = $c->user->area_ids; + my $area_ids = $c->user->area_ids || []; my $body = $c->user->from_body; - $c->detach('/page_error_404_not_found') unless $body && ($categories || $area_ids); + $c->detach('/page_error_404_not_found') unless $body && ($categories || @$area_ids); - if ($area_ids) { + if (@$area_ids) { my $ids_string = join ",", @$area_ids; my $areas = mySociety::MaPit::call('areas', [ $ids_string ]); $c->stash->{wards} = [ values %$areas ]; diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index afd8d6d17..aeb344922 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -82,7 +82,7 @@ FixMyStreet::override_config { for my $test ( { name => "categories only", - area_ids => undef, + area_ids => [], categories => [ $contact->id ], destination => "/reports/Oxfordshire", previous => "/my/inspector_redirect", |