diff options
author | Robin Appelman <robin@icewind.nl> | 2017-04-19 14:36:38 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-04-19 14:36:38 +0200 |
commit | ce2dba079605204293373652a53627eb50dd39d7 (patch) | |
tree | be548b5b98759fdbf412e18c89ecf77e291eff1e /lib | |
parent | a3569a14524f6f669bc9dc868658794ded12776a (diff) | |
download | nextcloud-server-ce2dba079605204293373652a53627eb50dd39d7.tar.gz nextcloud-server-ce2dba079605204293373652a53627eb50dd39d7.zip |
show error when trying to scan non existing path
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index e76f3225c3c..f845ac31fe2 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -32,6 +32,7 @@ use OC\ForbiddenException; use OC\Hooks\PublicEmitter; use OC\Lock\DBLockingProvider; use OCA\Files_Sharing\SharedStorage; +use OCP\Files\NotFoundException; use OCP\Files\Storage\IStorage; use OCP\Files\StorageNotAvailableException; use OCP\ILogger; @@ -216,6 +217,9 @@ class Scanner extends PublicEmitter { try { $propagator = $storage->getPropagator(); $propagator->beginBatch(); + if (!$storage->file_exists($relativePath)) { + throw new NotFoundException($dir); + } $scanner->scan($relativePath, \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG | \OC\Files\Cache\Scanner::REUSE_SIZE); $cache = $storage->getCache(); if ($cache instanceof Cache) { |