summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-06-18 14:17:41 +0200
committerGitHub <noreply@github.com>2021-06-18 14:17:41 +0200
commitbdb1525c16570d84f1fa5ed1031b12c3327a5fce (patch)
tree6b4d51d6d864ef7f58c6dca4cf8dc6b698293acd /lib
parent38edc6fdec105c023ead1fc2d6103d540be6266b (diff)
parent8520717b4f6661f2963516024d79473d2a0a3b48 (diff)
downloadnextcloud-server-bdb1525c16570d84f1fa5ed1031b12c3327a5fce.tar.gz
nextcloud-server-bdb1525c16570d84f1fa5ed1031b12c3327a5fce.zip
Merge pull request #27540 from nextcloud/getstoragerootid-failed-storage
handle case where storage can't be created in getStorageRootId
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Mount/MountPoint.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php
index 886c137bbcc..368be0a917e 100644
--- a/lib/private/Files/Mount/MountPoint.php
+++ b/lib/private/Files/Mount/MountPoint.php
@@ -268,7 +268,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;
}