summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Mount/MountPoint.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Mount/MountPoint.php')
-rw-r--r--lib/private/Files/Mount/MountPoint.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/private/Files/Mount/MountPoint.php b/lib/private/Files/Mount/MountPoint.php
index 67601f016be..20e08120080 100644
--- a/lib/private/Files/Mount/MountPoint.php
+++ b/lib/private/Files/Mount/MountPoint.php
@@ -196,11 +196,15 @@ class MountPoint implements IMountPoint {
}
/**
- * @return string
+ * @return string|null
*/
public function getStorageId() {
if (!$this->storageId) {
- $this->storageId = $this->getStorage()->getId();
+ $storage = $this->getStorage();
+ if (is_null($storage)) {
+ return null;
+ }
+ $this->storageId = $storage->getId();
if (strlen($this->storageId) > 64) {
$this->storageId = md5($this->storageId);
}
@@ -213,7 +217,11 @@ class MountPoint implements IMountPoint {
*/
public function getNumericStorageId() {
if (is_null($this->numericStorageId)) {
- $this->numericStorageId = $this->getStorage()->getStorageCache()->getNumericId();
+ $storage = $this->getStorage();
+ if (is_null($storage)) {
+ return -1;
+ }
+ $this->numericStorageId = $storage->getStorageCache()->getNumericId();
}
return $this->numericStorageId;
}