From 8520717b4f6661f2963516024d79473d2a0a3b48 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 17 Jun 2021 14:32:38 +0200 Subject: [PATCH] handle case where storage can't be created in getStorageRootId Signed-off-by: Robin Appelman --- lib/private/Files/Mount/MountPoint.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php index 886c137bbcc03..368be0a917e07 100644 --- a/lib/private/Files/Mount/MountPoint.php +++ b/lib/private/Files/Mount/MountPoint.php @@ -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; }