From ece41318b88fe77e182130e66e39f02fd7a96535 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 26 Jul 2018 15:33:26 +0200 Subject: Check if the favorite tag exists If the tag does not exist there is no need to do :boom: and log an exception on error level Signed-off-by: Roeland Jago Douma --- lib/private/Tags.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 10c9affa277..c5c0761971b 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -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) { -- cgit v1.2.3