aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/PhotoStorage.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/PhotoStorage.pm')
-rw-r--r--perllib/FixMyStreet/PhotoStorage.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/PhotoStorage.pm b/perllib/FixMyStreet/PhotoStorage.pm
index 9b0e5c9c3..256d46361 100644
--- a/perllib/FixMyStreet/PhotoStorage.pm
+++ b/perllib/FixMyStreet/PhotoStorage.pm
@@ -58,8 +58,10 @@ sub base64_decode_upload {
print $fh $decoded;
close $fh
} else {
- $c->log->info('Couldn\'t open temp file to save base64 decoded image: ' . $!);
- $c->stash->{photo_error} = _("Sorry, we couldn't save your file(s), please try again.");
+ if ($c) {
+ $c->log->info('Couldn\'t open temp file to save base64 decoded image: ' . $!);
+ $c->stash->{photo_error} = _("Sorry, we couldn't save your file(s), please try again.");
+ }
return ();
}
}