From 512571c54f40e0170d17ca83a9d2021384c6885a Mon Sep 17 00:00:00 2001 From: Florin Peter Date: Wed, 29 May 2013 20:11:13 +0200 Subject: [PATCH] fixes if cache returns false --- lib/public/share.php | 18 ++++++++++++++---- 1 file 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) { -- 2.39.5