]> source.dussan.org Git - nextcloud-server.git/commitdiff
adding null check on a mount's storage
authorThomas Müller <thomas.mueller@tmit.eu>
Sun, 15 Sep 2013 18:38:57 +0000 (20:38 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Sun, 15 Sep 2013 18:40:40 +0000 (20:40 +0200)
lib/files/utils/scanner.php

index f0dc41ffad3fe040190338e83383e4d97f5707fa..2cad7dd77bd53caa21b567d907302f6960771fe2 100644 (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);