diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php index e4d719a8b4..2dca0e0e67 100644 --- a/apps/files/command/scan.php +++ b/apps/files/command/scan.php @@ -77,7 +77,11 @@ class Scan extends Command { if (is_object($user)) { $user = $user->getUID(); } - $this->scanFiles($user, $output); + if ($this->userManager->userExists($user)) { + $this->scanFiles($user, $output); + } else { + $output->writeln("Unknown user $user"); + } } } }