Check if the favorite tag exists

If the tag does not exist there is no need to do 💥 and log an
exception on error level

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-07-26 15:33:26 +02:00
parent adcc061166
commit ece41318b8
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 4 additions and 0 deletions

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) {