summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Config/LazyStorageMountInfo.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-06-13 13:31:45 +0200
committerRobin Appelman <icewind@owncloud.com>2016-06-13 13:31:45 +0200
commit338cd4033ac0662a4077825d2084f53645af1865 (patch)
tree3ca2ec95afc0930573d20fd697bd2c3a94589885 /lib/private/Files/Config/LazyStorageMountInfo.php
parentf7c41fa4e68d50cc8332818d2e72fc95924ef90c (diff)
downloadnextcloud-server-338cd4033ac0662a4077825d2084f53645af1865.tar.gz
nextcloud-server-338cd4033ac0662a4077825d2084f53645af1865.zip
handle invalid storages in LazyStorageMountInfo
Diffstat (limited to 'lib/private/Files/Config/LazyStorageMountInfo.php')
-rw-r--r--lib/private/Files/Config/LazyStorageMountInfo.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/Config/LazyStorageMountInfo.php b/lib/private/Files/Config/LazyStorageMountInfo.php
index 654c5b2b23e..5df04c4b78e 100644
--- a/lib/private/Files/Config/LazyStorageMountInfo.php
+++ b/lib/private/Files/Config/LazyStorageMountInfo.php
@@ -28,7 +28,7 @@ use OCP\Files\Node;
use OCP\IUser;
class LazyStorageMountInfo extends CachedMountInfo {
- /** @var IMountPoint */
+ /** @var IMountPoint */
private $mount;
/**
@@ -47,7 +47,11 @@ class LazyStorageMountInfo extends CachedMountInfo {
*/
public function getStorageId() {
if (!$this->storageId) {
- $this->storageId = $this->mount->getStorage()->getStorageCache()->getNumericId();
+ $storage = $this->mount->getStorage();
+ if (!$storage) {
+ return -1;
+ }
+ $this->storageId = $storage->getStorageCache()->getNumericId();
}
return parent::getStorageId();
}