aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-01-14 10:19:50 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-01-14 11:24:20 +0000
commit799cd59b1d05fee1b98c83b3a39f12917ded9a91 (patch)
tree377d595e46ee4d682b7650d79e502fbafdd68f60 /perllib/FixMyStreet/Script
parent018da215a8c056f680202f128e0355c662b74c7f (diff)
Remove any use of `my $x if $foo`.
As perlsyn says, "NOTE: The behaviour of a `my`, `state`, or `our` modified with a statement modifier conditional or loop construct (for example, `my $x if ...`) is undefined. The value of the `my` variable may be `undef`, any previously assigned value, or possibly anything else."
Diffstat (limited to 'perllib/FixMyStreet/Script')
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index 5cadd4fa2..c1c4ab3f1 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -140,7 +140,9 @@ sub send(;$) {
}
$reporters{ $sender } ||= $sender->new();
- my $inspection_required = $sender_info->{contact}->get_extra_metadata('inspection_required') if $sender_info->{contact};
+ my $inspection_required = $sender_info->{contact}
+ ? $sender_info->{contact}->get_extra_metadata('inspection_required')
+ : undef;
if ( $inspection_required ) {
my $reputation_threshold = $sender_info->{contact}->get_extra_metadata('reputation_threshold') || 0;
my $reputation_threshold_met = 0;