Merge pull request #10409 from nextcloud/bugfix/noid/dont_fail_no_fav_tag

Check if the favorite tag exists
This commit is contained in:
Morris Jobke 2018-07-26 16:01:03 +02:00 committed by GitHub
commit bf61067d8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -624,6 +624,10 @@ class Tags implements \OCP\ITags {
* @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) {