diff --git a/lib/private/files/view.php b/lib/private/files/view.php index b1333b4150..6bf864c00a 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -988,7 +988,7 @@ class View { $this->updater->update($path, $extraParam); } - if ($operation === 'fopen') { + if ($operation === 'fopen' and $result) { $result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) { if (in_array('write', $hooks)) { $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);