Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-07-01 10:30:18 +0300
committerVincent Petry <pvince81@owncloud.com>2015-07-01 10:47:05 +0300
commitfd4efdded9d0dfbccfbeb15dfe40022e07174f3c (patch)
tree07ded44d244673257066bc5ce83cecabcdcfb251 /lib/private/connector/sabre/file.php
parentb5c9196ffcf8f5300d96e7d2bdd78f2695f6fd7a (diff)
Clean up part file only once, not twice on error
Diffstat (limited to 'lib/private/connector/sabre/file.php')
-rw-r--r--lib/private/connector/sabre/file.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 93244bea6ff..c28ac584998 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -189,7 +189,6 @@ class File extends Node implements IFile {
}
if (!$run || $renameOkay === false || $fileExists === false) {
\OC_Log::write('webdav', 'renaming part file to final file failed', \OC_Log::ERROR);
- $partStorage->unlink($internalPartPath);
throw new Exception('Could not rename part file to final file');
}
} catch (\Exception $e) {
@@ -350,6 +349,7 @@ class File extends Node implements IFile {
if ($chunk_handler->isComplete()) {
list($storage,) = $this->fileView->resolvePath($path);
$needsPartFile = $this->needsPartFile($storage);
+ $partFile = null;
try {
$targetPath = $path . '/' . $info['name'];
@@ -388,7 +388,7 @@ class File extends Node implements IFile {
$info = $this->fileView->getFileInfo($targetPath);
return $info->getEtag();
} catch (\Exception $e) {
- if ($partFile) {
+ if ($partFile !== null) {
$this->fileView->unlink($partFile);
}
$this->convertToSabreException($e);