Only delete part file on error if it is really a part file

remotes/origin/handlebars-approach
Vincent Petry 11 years ago
parent fd4efdded9
commit cf245b80fe
  1. 8
      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);
}

Loading…
Cancel
Save