aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/files/view.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 1037056b0fb..d310a0fa4e1 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -670,7 +670,12 @@ class View {
$source = fopen($tmpFile, 'r');
if ($source) {
$this->file_put_contents($path, $source);
- fclose($source);
+ // $this->file_put_contents() might have already closed
+ // the resource, so we check it, before trying to close it
+ // to avoid messages in the error log.
+ if (is_resource($source)) {
+ fclose($source);
+ }
unlink($tmpFile);
return true;
} else {