Skip to content
Snippets Groups Projects
Commit da0631e1 authored by Robin Appelman's avatar Robin Appelman
Browse files

Merge pull request #4860 from owncloud/fixing-potential-null-storage-on-scanner-master

adding null check on a mount's storage
parents 339c98e5 0f4e214a
Branches
No related tags found
No related merge requests found
......@@ -72,6 +72,9 @@ class Scanner extends PublicEmitter {
public function backgroundScan($dir) {
$mounts = $this->getMounts($dir);
foreach ($mounts as $mount) {
if (is_null($mount->getStorage())) {
continue;
}
$scanner = $mount->getStorage()->getScanner();
$this->attachListener($mount);
$scanner->backgroundScan();
......@@ -81,6 +84,9 @@ class Scanner extends PublicEmitter {
public function scan($dir) {
$mounts = $this->getMounts($dir);
foreach ($mounts as $mount) {
if (is_null($mount->getStorage())) {
continue;
}
$scanner = $mount->getStorage()->getScanner();
$this->attachListener($mount);
$scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment