From 71b8bb5d607ee750beb0699684f55cf207de7a1a Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 13 Sep 2018 11:10:45 -0600 Subject: [PATCH] fix: fixes #1867 --- services/tags.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/services/tags.js b/services/tags.js index 49d271c0b..1689cf7a9 100644 --- a/services/tags.js +++ b/services/tags.js @@ -5,7 +5,6 @@ const Assets = require('./assets'); const Settings = require('./settings'); const { ADD_COMMENT_TAG } = require('../perms/constants'); const { ErrNotAuthorized } = require('../errors'); -const { get, has } = require('lodash'); const updateModel = async (item_type, query, update) => { // Get the model to update with. @@ -60,8 +59,14 @@ class TagsService { asset = await Assets.findById(id); } - if (asset && has(asset, 'settings.tags')) { - return get(asset, 'settings.tags'); + // FIXME: comments ... + if ( + asset && + asset.settings && + asset.settings.tags && + Array.isArray(asset.settings.tags) + ) { + return asset.settings.tags; } // Extract the tags from the settings object.