diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-11-24 16:42:54 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-11-24 16:42:54 -0500 |
commit | c47bf9bbcefb0640c24ab0aa6ee79f4c52222b45 (patch) | |
tree | bb14ec2a885d16a3003c4de6400369216ffc59fa /apps/files/ajax/scan.php | |
parent | 555dec2d92316e47edd775d4e63ffe60fb0eca6b (diff) | |
download | nextcloud-server-c47bf9bbcefb0640c24ab0aa6ee79f4c52222b45.tar.gz nextcloud-server-c47bf9bbcefb0640c24ab0aa6ee79f4c52222b45.zip |
Add checks for storage object
Diffstat (limited to 'apps/files/ajax/scan.php')
-rw-r--r-- | apps/files/ajax/scan.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php index 53ae4f5ff04..391b98608bd 100644 --- a/apps/files/ajax/scan.php +++ b/apps/files/ajax/scan.php @@ -20,13 +20,14 @@ $mountPoints = array_reverse($mountPoints); //start with the mount point of $dir foreach ($mountPoints as $mountPoint) { $storage = \OC\Files\Filesystem::getStorage($mountPoint); - error_log('scanning mp '.$mountPoint); - ScanListener::$mountPoints[$storage->getId()] = $mountPoint; - $scanner = $storage->getScanner(); - if ($force) { - $scanner->scan(''); - } else { - $scanner->backgroundScan(); + if ($storage) { + ScanListener::$mountPoints[$storage->getId()] = $mountPoint; + $scanner = $storage->getScanner(); + if ($force) { + $scanner->scan(''); + } else { + $scanner->backgroundScan(); + } } } |