diff options
author | Robin Appelman <robin@icewind.nl> | 2021-06-17 14:32:38 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-06-17 14:32:38 +0200 |
commit | 8520717b4f6661f2963516024d79473d2a0a3b48 (patch) | |
tree | f2a0d9f27d0eb5cbc83ddfff0705b8090a8aa6fc /lib | |
parent | 39f0aa5abe0867a99218b76995d114ce7b394b84 (diff) | |
download | nextcloud-server-8520717b4f6661f2963516024d79473d2a0a3b48.tar.gz nextcloud-server-8520717b4f6661f2963516024d79473d2a0a3b48.zip |
handle case where storage can't be created in getStorageRootId
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Mount/MountPoint.php | 8 |
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; } |