diff --git a/modules/item/front/search-panel/index.js b/modules/item/front/search-panel/index.js index 530172a71..4dc38b88a 100644 --- a/modules/item/front/search-panel/index.js +++ b/modules/item/front/search-panel/index.js @@ -3,8 +3,8 @@ import SearchPanel from 'core/components/searchbar/search-panel'; class Controller extends SearchPanel { set filter(value) { - if (!value.tags) - value.tags = [{}]; + if (!value || !value.tags) + value = {tags: [{}]}; this.$.filter = value; } @@ -17,11 +17,11 @@ class Controller extends SearchPanel { if (!selection || selection.isFree === true) return null; - if (selection.sourceTable) + if (selection.sourceTable) { return '/api/' + selection.sourceTable.charAt(0).toUpperCase() + selection.sourceTable.substring(1) + 's'; - else if (selection.sourceTable == null) + } else if (selection.sourceTable == null) return `/api/ItemTags/filterItemTags/${selection.id}`; } }