diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-04-10 19:35:06 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-04-10 19:35:06 +0100 |
commit | 24185a5bdbfa10c04bc15a399204c84550b167e8 (patch) | |
tree | fd4884a4cef3fe2750968fb07926731dee0f260d | |
parent | 1b606205eb9441434eba6c5272cdf8945bfa32d2 (diff) |
Check for no body_areas entries (e.g. deleted councils).
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index bbb60f4e7..deb14ea77 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -321,7 +321,9 @@ sub ward_check : Private { # Could be from RSS area, or body... my $parent_id; if ( $c->stash->{body} ) { - $parent_id = $c->stash->{body}->body_areas->first->area_id; + $parent_id = $c->stash->{body}->body_areas->first; + $c->detach( 'redirect_body' ) unless $parent_id; + $parent_id = $parent_id->area_id; } else { $parent_id = $c->stash->{area}->{id}; } |