aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib/Trash/LegacyTrashBackend.php')
-rw-r--r--apps/files_trashbin/lib/Trash/LegacyTrashBackend.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php b/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php
index 3e749169ad2..ada42dbe857 100644
--- a/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php
+++ b/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php
@@ -28,6 +28,7 @@ use OCA\Files_Trashbin\Helper;
use OCA\Files_Trashbin\Storage;
use OCA\Files_Trashbin\Trashbin;
use OCP\Files\FileInfo;
+use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorage;
@@ -121,11 +122,11 @@ class LegacyTrashBackend implements ITrashBackend {
try {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
$trash = $userFolder->getParent()->get('files_trashbin/files');
- $trashFiles = $trash->getById($fileId);
- if (!$trashFiles) {
+ if ($trash instanceof Folder) {
+ return $trash->getFirstNodeById($fileId);
+ } else {
return null;
}
- return $trashFiles ? array_pop($trashFiles) : null;
} catch (NotFoundException $e) {
return null;
}