summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricewind1991 <robin@icewind.nl>2013-09-15 13:47:16 -0700
committericewind1991 <robin@icewind.nl>2013-09-15 13:47:16 -0700
commitda0631e1854529493b405c3c6036c91bd941a6ba (patch)
tree5c145a8e47efb9175868575e600a71613160652b
parent339c98e5e69103806f03d1eac660f69d1583c5c2 (diff)
parent0f4e214a904952188747716b36f5dfd5a0f0c0d9 (diff)
downloadnextcloud-server-da0631e1854529493b405c3c6036c91bd941a6ba.tar.gz
nextcloud-server-da0631e1854529493b405c3c6036c91bd941a6ba.zip
Merge pull request #4860 from owncloud/fixing-potential-null-storage-on-scanner-master
adding null check on a mount's storage
-rw-r--r--lib/files/utils/scanner.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/files/utils/scanner.php b/lib/files/utils/scanner.php
index f0dc41ffad3..2cad7dd77bd 100644
--- a/lib/files/utils/scanner.php
+++ b/lib/files/utils/scanner.php
@@ -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);