diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index ae04e3bec4dd2d118e985ccff76f71f4096fc86a..8818b822fa7d75671cb51aeda30f20f0614cdae3 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -364,8 +364,12 @@ class Encryption extends Wrapper {
 					$encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId);
 				}
 
-				$size = $this->storage->filesize($path);
-				$unencryptedSize = $this->filesize($path);
+				if ($this->file_exists($path)) {
+					$size = $this->storage->filesize($path);
+					$unencryptedSize = $this->filesize($path);
+				} else {
+					$size = $unencryptedSize = 0;
+				}
 			}
 
 			try {