Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/groupfolders.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-09-25 19:12:14 +0300
committerRobin Appelman <robin@icewind.nl>2019-09-25 19:12:14 +0300
commit905bb2d87fa9afefe4c19184cb41b62ea0c3f649 (patch)
tree9611774ffbfd357b8697d3a5f326f90b03792413
parentc440e0ab241fb09c9a97b66328ddc6d1bdc46255 (diff)
dont remove trash item from cache if the delete failed
-rw-r--r--lib/Trash/TrashBackend.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php
index b0f04135..b5df6fbc 100644
--- a/lib/Trash/TrashBackend.php
+++ b/lib/Trash/TrashBackend.php
@@ -115,7 +115,9 @@ class TrashBackend implements ITrashBackend {
if ($node === null) {
throw new NotFoundException();
}
- $node->getStorage()->unlink($node->getInternalPath());
+ if ($node->getStorage()->unlink($node->getInternalPath()) === false) {
+ throw new \Exception('Failed to remove item from trashbin');
+ }
$node->getStorage()->getCache()->remove($node->getInternalPath());
if ($item->isRootItem()) {
$this->trashManager->removeItem($folderId, $item->getName(), $item->getDeletedTime());