diff --git a/lib/utils.js b/lib/utils.js index 94e4ace..c6dea28 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -18,7 +18,7 @@ const DEFAULT_CONTEXT = { exports.parseFilters = json => { const pc = json.contents.twoColumnSearchResultsRenderer.primaryContents; const wrapper = pc.sectionListRenderer || pc.richGridRenderer; - const filterWrapper = (wrapper.subMenu || wrapper.submenu).searchSubMenuRenderer.groups; + const filterWrapper = ((wrapper.subMenu || wrapper.submenu)?.searchSubMenuRenderer || {}).groups || []; const parsedGroups = new Map(); for (const filterGroup of filterWrapper) { const singleFilterGroup = new Map();