summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-29 20:11:13 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-31 12:27:55 +0200
commit512571c54f40e0170d17ca83a9d2021384c6885a (patch)
tree423a2cbce1c190ad58f22a048e7e2c1edffe71a6 /lib/public
parent0fa0e92883c614412deefd9600de3bb7e571f461 (diff)
downloadnextcloud-server-512571c54f40e0170d17ca83a9d2021384c6885a.tar.gz
nextcloud-server-512571c54f40e0170d17ca83a9d2021384c6885a.zip
fixes if cache returns false
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/share.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index caf208255ae..28822cf00d9 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -138,11 +138,17 @@ class Share {
$shares = array();
$publicShare = false;
+ $source = '-1';
+ $cache = false;
+
$view = new \OC\Files\View('/' . $user . '/files/');
$meta = $view->getFileInfo(\OC_Filesystem::normalizePath($path));
- $source = $meta['fileid'];
- $cache = new \OC\Files\Cache\Cache($meta['storage']);
-
+
+ if($meta !== false) {
+ $source = $meta['fileid'];
+ $cache = new \OC\Files\Cache\Cache($meta['storage']);
+ }
+
while ($source !== '-1') {
// Fetch all shares of this file path from DB
@@ -207,7 +213,11 @@ class Share {
// let's get the parent for the next round
$meta = $cache->get((int)$source);
- $source = $meta['parent'];
+ if($meta !== false) {
+ $source = $meta['parent'];
+ } else {
+ $source = '-1';
+ }
}
// Include owner in list of users, if requested
if ($includeOwner) {