Skip to content

Commit 68990b2

Browse files
icewind1991backportbot[bot]
authored andcommitted
handle case where storage can't be created in getStorageRootId
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 028efff commit 68990b2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/private/Files/Mount/MountPoint.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,13 @@ public function getOptions() {
269269
*/
270270
public function getStorageRootId() {
271271
if (is_null($this->rootId) || $this->rootId === -1) {
272-
$this->rootId = (int)$this->getStorage()->getCache()->getId('');
272+
$storage = $this->getStorage();
273+
// 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
274+
if ($storage === null) {
275+
$this->rootId = -1;
276+
} else {
277+
$this->rootId = (int)$storage->getCache()->getId('');
278+
}
273279
}
274280
return $this->rootId;
275281
}

0 commit comments

Comments
 (0)