aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Photo.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/App/Controller/Photo.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/App/Controller/Photo.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Photo.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm
index 5712350ed..7b536a292 100644
--- a/perllib/FixMyStreet/App/Controller/Photo.pm
+++ b/perllib/FixMyStreet/App/Controller/Photo.pm
@@ -82,7 +82,7 @@ sub output : Private {
# Save to file
path(FixMyStreet->path_to('web', 'photo', 'c'))->mkpath;
my $out = FixMyStreet->path_to('web', $c->req->path);
- my $symlink_exists = symlink($photo->{symlink}, $out) if $photo->{symlink};
+ my $symlink_exists = $photo->{symlink} ? symlink($photo->{symlink}, $out) : undef;
path($out)->spew_raw($photo->{data}) unless $symlink_exists;
$c->res->content_type( $photo->{content_type} );