Skip to content
Snippets Groups Projects
Commit 9ead7c47 authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Don't unlink old renamed file if stream copy failed

parent 4f6f6456
No related branches found
No related tags found
No related merge requests found
......@@ -370,7 +370,9 @@ class View {
$target = $this->fopen($path2 . $postFix2, 'w');
list($count, $result) = \OC_Helper::streamCopy($source, $target);
list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1);
$storage1->unlink($internalPath1);
if ($result !== false) {
$storage1->unlink($internalPath1);
}
}
if ($this->fakeRoot == Filesystem::getRoot() && $result !== false) {
\OC_Hook::emit(
......
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