summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre/file.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-07-01 12:52:06 +0200
committerVincent Petry <pvince81@owncloud.com>2015-07-01 12:52:06 +0200
commitcf245b80fe8bf0aed2b227e7f2cef5a15d3c5c8b (patch)
tree537b50342f0758641cbdf6eea2c74f1d2af83e87 /lib/private/connector/sabre/file.php
parentfd4efdded9d0dfbccfbeb15dfe40022e07174f3c (diff)
downloadnextcloud-server-cf245b80fe8bf0aed2b227e7f2cef5a15d3c5c8b.tar.gz
nextcloud-server-cf245b80fe8bf0aed2b227e7f2cef5a15d3c5c8b.zip
Only delete part file on error if it is really a part file
Diffstat (limited to 'lib/private/connector/sabre/file.php')
-rw-r--r--lib/private/connector/sabre/file.php8
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);
}