Removes misleading error message in occ files:scan for new users.

Previously the occ files:scan command printed an error message for any
new users without any files/folders in the data directory.
With this change only users with any file/folder is scanned.

This fixes #25433.

Signed-off-by: Christian Paier <hallo+git@cpaier.com>
This commit is contained in:
Christian Paier 2022-02-05 23:26:55 +01:00
parent 9c2db7f4e4
commit 9476ce70ed

View file

@ -216,7 +216,7 @@ class Scanner extends PublicEmitter {
if ($storage->instanceOfStorage('\OC\Files\Storage\Home') and
(!$storage->isCreatable('') or !$storage->isCreatable('files'))
) {
if ($storage->file_exists('') or $storage->getCache()->inCache('')) {
if ($storage->is_dir('files')) {
throw new ForbiddenException();
} else {// if the root exists in neither the cache nor the storage the user isn't setup yet
break;