diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-01 12:52:06 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-07-01 15:25:17 +0200 |
commit | 4aa2eff94c2fefa20fe4b26b6677074ee129ca50 (patch) | |
tree | b717e56dc07e44f9d23fd8ea790590157fbcdb14 | |
parent | 4fff832fa6aa9c054eac4aeecb7eb55a9860343e (diff) | |
download | nextcloud-server-4aa2eff94c2fefa20fe4b26b6677074ee129ca50.tar.gz nextcloud-server-4aa2eff94c2fefa20fe4b26b6677074ee129ca50.zip |
Only delete part file on error if it is really a part file
-rw-r--r-- | lib/private/connector/sabre/file.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index c28ac584998..e4f53a219d2 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -146,7 +146,9 @@ class File extends Node implements IFile { } } catch (\Exception $e) { - $partStorage->unlink($internalPartPath); + if ($needsPartFile) { + $partStorage->unlink($internalPartPath); + } $this->convertToSabreException($e); } @@ -176,7 +178,9 @@ class File extends Node implements IFile { try { $this->fileView->changeLock($this->path, ILockingProvider::LOCK_EXCLUSIVE); } catch (LockedException $e) { - $partStorage->unlink($internalPartPath); + if ($needsPartFile) { + $partStorage->unlink($internalPartPath); + } throw new FileLocked($e->getMessage(), $e->getCode(), $e); } |