diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 6bce415a6..054be3644 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -201,10 +201,11 @@ sub belongs_to_body { my $self = shift; my $bodies = shift; - my %bodies = map { $_ => 1 } split ',', $bodies; + return 0 unless $bodies && $self->from_body; - return 1 if $self->from_body && $bodies{ $self->from_body->id }; + my %bodies = map { $_ => 1 } split ',', $bodies; + return 1 if $bodies{ $self->from_body->id }; return 0; } |