diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2015-01-19 17:05:43 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2015-01-23 10:11:14 +0100 |
commit | 7e6d2c73d22f919229bd955b2fd6a9aa2973791e (patch) | |
tree | a6b7e7f88e0122052f731b6781bf3a817fb35221 /apps/files/service | |
parent | bc93a8f14094dfb59c826ffa76d7b046370b0410 (diff) | |
download | nextcloud-server-7e6d2c73d22f919229bd955b2fd6a9aa2973791e.tar.gz nextcloud-server-7e6d2c73d22f919229bd955b2fd6a9aa2973791e.zip |
Ignore favorites that are not available when creating the favorites list
Also correctly return the exception for all cases when adding/removing favos
Diffstat (limited to 'apps/files/service')
-rw-r--r-- | apps/files/service/tagservice.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/files/service/tagservice.php b/apps/files/service/tagservice.php index 86885e38ddd..fe26838552a 100644 --- a/apps/files/service/tagservice.php +++ b/apps/files/service/tagservice.php @@ -8,6 +8,8 @@ namespace OCA\Files\Service; +use OC\Files\FileInfo; + /** * Service class to manage tags on files. */ @@ -84,11 +86,19 @@ class TagService { $nodes = $this->homeFolder->searchByTag( $tagName, $this->userSession->getUser()->getUId() ); - foreach ($nodes as &$node) { - $node = $node->getFileInfo(); + $fileInfos = []; + foreach ($nodes as $node) { + try { + /** @var \OC\Files\Node\Node $node */ + $fileInfos[] = $node->getFileInfo(); + } catch (\Exception $e) { + // FIXME Should notify the user, when this happens + // Can not get FileInfo, maybe the connection to the external + // storage is interrupted. + } } - return $nodes; + return $fileInfos; } } |