diff --git a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php index f1e2bf75f1a60..5df0061145e33 100644 --- a/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php +++ b/apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php @@ -90,7 +90,7 @@ private function getTrashRoot(IUser $user): Folder { $this->setupManager->tearDown(); $this->setupManager->setupForUser($user); - $folder = $this->rootFolder->getUserFolder($user->getUID())->getParent()->get('files_trashbin'); + $folder = $this->rootFolder->getUserFolder($user->getUID())->getParent()->getOrCreateFolder('files_trashbin'); if (!$folder instanceof Folder) { throw new \LogicException("Didn't expect files_trashbin to be a file instead of a folder"); }