diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-12-11 01:06:21 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-12-11 01:06:21 +0100 |
commit | 8635699db932959ac147193473b014406b0e9e09 (patch) | |
tree | d57eaf759504fa7bb347848ad732e7a379099c53 /lib/files/view.php | |
parent | 317cd4c70a3042c4e16424cafb4a8b34c8cd8c3c (diff) | |
download | nextcloud-server-8635699db932959ac147193473b014406b0e9e09.tar.gz nextcloud-server-8635699db932959ac147193473b014406b0e9e09.zip |
fix cache behaviour for non existing files
Diffstat (limited to 'lib/files/view.php')
-rw-r--r-- | lib/files/view.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/files/view.php b/lib/files/view.php index 468808566a7..994dbcc85cf 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -691,20 +691,22 @@ class View { $data = $cache->get($internalPath); - if ($data['mimetype'] === 'httpd/unix-directory') { - //add the sizes of other mountpoints to the folder - $mountPoints = Filesystem::getMountPoints($path); - foreach ($mountPoints as $mountPoint) { - $subStorage = Filesystem::getStorage($mountPoint); - $subCache = $subStorage->getCache(); - $rootEntry = $subCache->get(''); - - $data['size'] += $rootEntry['size']; + if ($data) { + if ($data['mimetype'] === 'httpd/unix-directory') { + //add the sizes of other mountpoints to the folder + $mountPoints = Filesystem::getMountPoints($path); + foreach ($mountPoints as $mountPoint) { + $subStorage = Filesystem::getStorage($mountPoint); + $subCache = $subStorage->getCache(); + $rootEntry = $subCache->get(''); + + $data['size'] += $rootEntry['size']; + } } - } - $permissionsCache = $storage->getPermissionsCache(); - $data['permissions'] = $permissionsCache->get($data['fileid'], \OC_User::getUser()); + $permissionsCache = $storage->getPermissionsCache(); + $data['permissions'] = $permissionsCache->get($data['fileid'], \OC_User::getUser()); + } } return $data; } @@ -888,7 +890,7 @@ class View { * @param string $path * @return string */ - public function getETag($path){ + public function getETag($path) { /** * @var Storage\Storage $storage * @var string $internalPath |