Skip to content

Commit

Permalink
Merge pull request #27540 from nextcloud/getstoragerootid-failed-storage
Browse files Browse the repository at this point in the history
handle case where storage can't be created in getStorageRootId
  • Loading branch information
juliusknorr authored Jun 18, 2021
2 parents 38edc6f + 8520717 commit bdb1525
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/private/Files/Mount/MountPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ public function getOptions() {
*/
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;
}
Expand Down

0 comments on commit bdb1525

Please sign in to comment.