diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-06-17 18:28:00 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-06-17 18:28:00 +0100 |
commit | 948338c4cfa30885f552f775a8727bf3b34859f1 (patch) | |
tree | b33df0cac82b0da0b49fec659f6db2552e673140 | |
parent | 6d3ab9722b91e4929d01d168dfc0dc0916a8b542 (diff) |
Prevent uninitialized value warnings.
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Contact.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Contact.pm b/perllib/FixMyStreet/DB/Result/Contact.pm index 1fa38e8a2..5cf3302dd 100644 --- a/perllib/FixMyStreet/DB/Result/Contact.pm +++ b/perllib/FixMyStreet/DB/Result/Contact.pm @@ -180,10 +180,12 @@ sub disable_form_field { sub sent_by_open311 { my $self = shift; my $body = $self->body; + my $method = $self->send_method || ''; + my $body_method = $body->send_method || ''; return 1 if - (!$body->can_be_devolved && $body->send_method eq 'Open311') - || ($body->can_be_devolved && $body->send_method eq 'Open311' && !$self->send_method) - || ($body->can_be_devolved && $self->send_method eq 'Open311'); + (!$body->can_be_devolved && $body_method eq 'Open311') + || ($body->can_be_devolved && $body_method eq 'Open311' && !$method) + || ($body->can_be_devolved && $method eq 'Open311'); return 0; } |