Skip to content

Commit

Permalink
Merge pull request #10409 from nextcloud/bugfix/noid/dont_fail_no_fav…
Browse files Browse the repository at this point in the history
…_tag

Check if the favorite tag exists
  • Loading branch information
MorrisJobke authored Jul 26, 2018
2 parents adcc061 + ece4131 commit bf61067
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ public function purgeObjects(array $ids) {
* @return array|false An array of object ids.
*/
public function getFavorites() {
if(!$this->userHasTag(self::TAG_FAVORITE, $this->user)) {
return [];
}

try {
return $this->getIdsForTag(self::TAG_FAVORITE);
} catch(\Exception $e) {
Expand Down

0 comments on commit bf61067

Please sign in to comment.