adding null check on a mount's storage
This commit is contained in:
parent
339c98e5e6
commit
0f4e214a90
|
@ -72,6 +72,9 @@ class Scanner extends PublicEmitter {
|
||||||
public function backgroundScan($dir) {
|
public function backgroundScan($dir) {
|
||||||
$mounts = $this->getMounts($dir);
|
$mounts = $this->getMounts($dir);
|
||||||
foreach ($mounts as $mount) {
|
foreach ($mounts as $mount) {
|
||||||
|
if (is_null($mount->getStorage())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$scanner = $mount->getStorage()->getScanner();
|
$scanner = $mount->getStorage()->getScanner();
|
||||||
$this->attachListener($mount);
|
$this->attachListener($mount);
|
||||||
$scanner->backgroundScan();
|
$scanner->backgroundScan();
|
||||||
|
@ -81,6 +84,9 @@ class Scanner extends PublicEmitter {
|
||||||
public function scan($dir) {
|
public function scan($dir) {
|
||||||
$mounts = $this->getMounts($dir);
|
$mounts = $this->getMounts($dir);
|
||||||
foreach ($mounts as $mount) {
|
foreach ($mounts as $mount) {
|
||||||
|
if (is_null($mount->getStorage())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$scanner = $mount->getStorage()->getScanner();
|
$scanner = $mount->getStorage()->getScanner();
|
||||||
$this->attachListener($mount);
|
$this->attachListener($mount);
|
||||||
$scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG);
|
$scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG);
|
||||||
|
|
Loading…
Reference in New Issue