diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php index 12098ebc6..4b7b0d316 100644 --- a/lib/Trash/TrashBackend.php +++ b/lib/Trash/TrashBackend.php @@ -260,10 +260,7 @@ public function moveToTrash(IStorage $storage, string $internalPath): bool { $name = basename($internalPath); $fileEntry = $storage->getCache()->get($internalPath); $folderId = $storage->getFolderId(); - $user = $this->userSession->getUser(); - if (!$user) { - throw new \Exception("file moved to trash with no user in context"); - } + // ensure the folder exists $this->getTrashFolder($folderId);