summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-04-13 15:04:46 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-04-13 15:04:46 -0400
commit9ead7c4776bd512c2a50ab917b99dcdc37e8db68 (patch)
treefd7b5027404934c0a8a901bc3593f6fbd38e1294 /lib
parent4f6f6456aad8777ac722fb7bb061d2978d702647 (diff)
downloadnextcloud-server-9ead7c4776bd512c2a50ab917b99dcdc37e8db68.tar.gz
nextcloud-server-9ead7c4776bd512c2a50ab917b99dcdc37e8db68.zip
Don't unlink old renamed file if stream copy failed
Diffstat (limited to 'lib')
-rw-r--r--lib/files/view.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/files/view.php b/lib/files/view.php
index b0e82919359..d2d1a99818b 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -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(