aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Default.pm
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/Cobrand/Default.pm
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/Cobrand/Default.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 88d208c85..6c91da640 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -530,7 +530,7 @@ sub find_closest {
my $problem = $data->{problem};
my $lat = $problem ? $problem->latitude : $data->{latitude};
my $lon = $problem ? $problem->longitude : $data->{longitude};
- my $j = $problem->geocode if $problem;
+ my $j = $problem ? $problem->geocode : undef;
if (!$j) {
$j = FixMyStreet::Geocode::Bing::reverse( $lat, $lon,