aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Utils/Scanner.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Utils/Scanner.php')
-rw-r--r--lib/private/Files/Utils/Scanner.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index e76f3225c3c..02f355fd4d9 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;
@@ -161,6 +162,7 @@ class Scanner extends PublicEmitter {
/**
* @param string $dir
* @throws \OC\ForbiddenException
+ * @throws \OCP\Files\NotFoundException
*/
public function scan($dir = '') {
if (!Filesystem::isValidPath($dir)) {
@@ -210,6 +212,9 @@ class Scanner extends PublicEmitter {
$this->triggerPropagator($storage, $path);
});
+ if (!$storage->file_exists($relativePath)) {
+ throw new NotFoundException($dir);
+ }
if (!$isDbLocking) {
$this->db->beginTransaction();
}