diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-04-21 19:47:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-21 19:47:33 +0200 |
commit | 867b3ee234b91ce5fbbbf3b81a5bcce59a0179a3 (patch) | |
tree | 50cd7d5390ae88c392628da9d6473c1e31dfb117 /lib/private | |
parent | d46b155916c4c49fffb5bf8c4391331ce90b44c1 (diff) | |
parent | a0e5107c0b01d6ade0fe28f248c418ab5fd95d62 (diff) | |
download | nextcloud-server-867b3ee234b91ce5fbbbf3b81a5bcce59a0179a3.tar.gz nextcloud-server-867b3ee234b91ce5fbbbf3b81a5bcce59a0179a3.zip |
Merge pull request #4396 from nextcloud/scan-non-existing
show error when trying to scan non existing path
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 5 |
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(); } |