Browse Source

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

adding null check on a mount's storage
tags/v6.0.0alpha2
icewind1991 11 years ago
parent
commit
da0631e185
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      lib/files/utils/scanner.php

+ 6
- 0
lib/files/utils/scanner.php View File

@@ -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);

Loading…
Cancel
Save