Skip to content
Snippets Groups Projects
Commit cf245b80 authored by Vincent Petry's avatar Vincent Petry
Browse files

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

parent fd4efdde
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment