summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2021-06-17 14:32:38 +0200
committerMichaIng <micha@dietpi.com>2021-09-30 13:21:40 +0200
commit4180ca7a0b77025a317de35c9eba30924d943a25 (patch)
tree9579b0c9748bfac40c380f96a2b9fa3ccfad9ec7
parenta7859c550201ebe78ff14e8237165dd5c9d86e7b (diff)
downloadnextcloud-server-4180ca7a0b77025a317de35c9eba30924d943a25.tar.gz
nextcloud-server-4180ca7a0b77025a317de35c9eba30924d943a25.zip
handle case where storage can't be created in getStorageRootId
Signed-off-by: Robin Appelman <robin@icewind.nl>
-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 cbf3785c409..198465bd9bc 100644
--- a/lib/private/Files/Mount/MountPoint.php
+++ b/lib/private/Files/Mount/MountPoint.php
@@ -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;
}