diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 4419ecd92..c6ede88f7 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -132,7 +132,16 @@ sub category_extras_ajax : Path('category_extras') : Args(0) { my ( $self, $c ) = @_; $c->forward('initialize_report'); - $c->forward('determine_location') or return 0; + if ( ! $c->forward('determine_location') ) { + my $body = JSON->new->utf8(1)->encode( + { + error => _("Sorry, we could not find that location."), + } + ); + $c->res->content_type('application/json; charset=utf-8'); + $c->res->body($body); + return 1; + } $c->forward('setup_categories_and_councils'); my $category_extra = ''; |