summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-07-26 15:33:26 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-07-26 15:33:26 +0200
commitece41318b88fe77e182130e66e39f02fd7a96535 (patch)
treecfc9f363281dbf31a35d5ee82b7b5d131e70ccf0 /lib
parentadcc061166ab86bd39b004bd85847320fdd2d525 (diff)
downloadnextcloud-server-ece41318b88fe77e182130e66e39f02fd7a96535.tar.gz
nextcloud-server-ece41318b88fe77e182130e66e39f02fd7a96535.zip
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 <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Tags.php4
1 files changed, 4 insertions, 0 deletions
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) {