aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Dashboard.pm
diff options
context:
space:
mode:
authorM Somerville <matthew-github@dracos.co.uk>2020-08-04 15:05:55 +0100
committerM Somerville <matthew-github@dracos.co.uk>2020-08-04 15:05:55 +0100
commit994093c4675393bca6b84747e87a63e10cb063d9 (patch)
tree02db646fe452faada138c68fb07a734c1dc2875c /perllib/FixMyStreet/App/Controller/Dashboard.pm
parent361bf0bc0d8b5e86ae2cde5f428129ae23af5999 (diff)
Do not error in export if report has bad category.
If category groups are enabled, the CSV export includes a subcategory, but it was only fetching a valid groups value if the row's contact was found.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Dashboard.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm
index abb2e0988..f7273ca0e 100644
--- a/perllib/FixMyStreet/App/Controller/Dashboard.pm
+++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm
@@ -493,7 +493,7 @@ sub generate_csv : Private {
}
if ($asked_for{subcategory}) {
- my $group = $obj->contact && $obj->contact->groups;
+ my $group = $obj->contact ? $obj->contact->groups : [];
$group = join(',', @$group);
if ($group) {
$hashref->{subcategory} = $obj->category;