Merge pull request #28730 from nextcloud/backport/27540/stable21

This commit is contained in:
Julius Härtl 2021-10-04 16:51:02 +02:00 committed by GitHub
commit f82c4d31ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,7 +269,13 @@ class MountPoint implements IMountPoint {
*/
public function getStorageRootId() {
if (is_null($this->rootId) || $this->rootId === -1) {
$this->rootId = (int)$this->getStorage()->getCache()->getId('');
$storage = $this->getStorage();
// if we can't create the storage return -1 as root id, this is then handled the same as if the root isn't scanned yet
if ($storage === null) {
$this->rootId = -1;
} else {
$this->rootId = (int)$storage->getCache()->getId('');
}
}
return $this->rootId;
}