diff options
author | Robin Appelman <robin@icewind.nl> | 2019-09-25 19:12:14 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-09-25 19:12:14 +0300 |
commit | 905bb2d87fa9afefe4c19184cb41b62ea0c3f649 (patch) | |
tree | 9611774ffbfd357b8697d3a5f326f90b03792413 | |
parent | c440e0ab241fb09c9a97b66328ddc6d1bdc46255 (diff) |
dont remove trash item from cache if the delete failed
-rw-r--r-- | lib/Trash/TrashBackend.php | 4 |
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()); |