aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index 90e5895d5..4b4363ee3 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -326,6 +326,8 @@ sub add_admin_subcategories {
my $c = $self->{c};
my $user = $c->stash->{user};
+ return unless $user; # e.g. admin templates, not user
+
my @subcategories = @{$user->get_extra_metadata('subcategories') || []};
my %active_contacts = map { $_ => 1 } @subcategories;
@@ -337,7 +339,7 @@ sub add_admin_subcategories {
foreach (@{$subcats{$_->{id}}}) {
push @new_contacts, {
id => $_->{key},
- category => (" " x 4) . $_->{name},
+ category => (" " x 4) . $_->{name}, # nbsp
active => $active_contacts{$_->{key}},
};
}