Only delete part file on error if it is really a part file
This commit is contained in:
parent
fd4efdded9
commit
cf245b80fe
1 changed files with 6 additions and 2 deletions
|
@ -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…
Reference in a new issue