diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-06-13 13:31:45 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-06-13 13:31:45 +0200 |
commit | 338cd4033ac0662a4077825d2084f53645af1865 (patch) | |
tree | 3ca2ec95afc0930573d20fd697bd2c3a94589885 /lib/private/Files/Config/UserMountCache.php | |
parent | f7c41fa4e68d50cc8332818d2e72fc95924ef90c (diff) | |
download | nextcloud-server-338cd4033ac0662a4077825d2084f53645af1865.tar.gz nextcloud-server-338cd4033ac0662a4077825d2084f53645af1865.zip |
handle invalid storages in LazyStorageMountInfo
Diffstat (limited to 'lib/private/Files/Config/UserMountCache.php')
-rw-r--r-- | lib/private/Files/Config/UserMountCache.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index edb1525b276..c9470048601 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -124,12 +124,16 @@ class UserMountCache implements IUserMountCache { } private function addToCache(ICachedMountInfo $mount) { - $this->connection->insertIfNotExist('*PREFIX*mounts', [ - 'storage_id' => $mount->getStorageId(), - 'root_id' => $mount->getRootId(), - 'user_id' => $mount->getUser()->getUID(), - 'mount_point' => $mount->getMountPoint() - ], ['root_id', 'user_id']); + if ($mount->getStorageId() !== -1) { + $this->connection->insertIfNotExist('*PREFIX*mounts', [ + 'storage_id' => $mount->getStorageId(), + 'root_id' => $mount->getRootId(), + 'user_id' => $mount->getUser()->getUID(), + 'mount_point' => $mount->getMountPoint() + ], ['root_id', 'user_id']); + } else { + $this->logger->error('Error getting storage info for mount at ' . $mount->getMountPoint()); + } } private function setMountPoint(ICachedMountInfo $mount) { |