From 5322ad767878babb403a6b5c7c3b51bc6c94d484 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Fri, 12 Apr 2019 15:29:45 +0300 Subject: [PATCH] Filter unavailable users --- .../lib/Command/PollIncomingShares.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/federatedfilesharing/lib/Command/PollIncomingShares.php b/apps/federatedfilesharing/lib/Command/PollIncomingShares.php index 4ad70b6d5dd3..c8e36635e0b3 100644 --- a/apps/federatedfilesharing/lib/Command/PollIncomingShares.php +++ b/apps/federatedfilesharing/lib/Command/PollIncomingShares.php @@ -82,6 +82,13 @@ public function execute(InputInterface $input, OutputInterface $output) { $cursor = $this->getCursor(); while ($data = $cursor->fetch()) { $user = $this->userManager->get($data['user']); + if ($user === null) { + $output->writeln( + "Skipping user \"{$data['user']}\". Reason: user manager was unable to resolve the uid into the user object" + ); + continue; + } + $userMounts = $this->externalMountProvider->getMountsForUser($user, $this->loader); /** @var \OCA\Files_Sharing\External\Mount $mount */ foreach ($userMounts as $mount) {