diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 3ce21a3489ba5761d5202d355e71dba3e59b3b99..6facc7b9462caa771d18b395503fef7b0fc0956b 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1132,13 +1132,13 @@ class View {
 					throw $e;
 				}
 
-				if (in_array('delete', $hooks) and $result) {
+				if ($result && in_array('delete', $hooks) and $result) {
 					$this->removeUpdate($storage, $internalPath);
 				}
-				if (in_array('write', $hooks) and $operation !== 'fopen') {
+				if ($result && in_array('write', $hooks) and $operation !== 'fopen') {
 					$this->writeUpdate($storage, $internalPath);
 				}
-				if (in_array('touch', $hooks)) {
+				if ($result && in_array('touch', $hooks)) {
 					$this->writeUpdate($storage, $internalPath, $extraParam);
 				}