From 238724eed1abd464f7ea60c703f5b899d01478c8 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 4 Mar 2024 23:57:47 -0500 Subject: [PATCH] Fix looking-up unexisting sections in "Filter lists" pane Related feedback: https://old.reddit.com/r/uBlockOrigin/comments/1b6tad0/i_updated_to_the_new_dev_build_1561b10_and_now/ --- src/js/3p-filters.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/js/3p-filters.js b/src/js/3p-filters.js index 742bab7d4..7ad5fadc1 100644 --- a/src/js/3p-filters.js +++ b/src/js/3p-filters.js @@ -238,8 +238,9 @@ const renderFilterLists = ( ) => { }; } for ( const [ listkey, listDetails ] of Object.entries(response.available) ) { - let groupKey = listDetails.group; - const groupDetails = listTree[groupKey]; + const groupkey = listDetails.group; + const groupDetails = listTree[groupkey]; + if ( groupDetails === undefined ) { continue; } if ( listDetails.parent !== undefined ) { let lists = groupDetails.lists; for ( const parent of listDetails.parent.split('|') ) { @@ -257,8 +258,9 @@ const renderFilterLists = ( ) => { // https://github.com/uBlockOrigin/uBlock-issues/issues/3154#issuecomment-1975413427 // Remove empty sections for ( const groupkey of groupKeys ) { - const lists = listTree[groupkey].lists; - if ( Object.keys(lists).length !== 0 ) { continue; } + const groupDetails = listTree[groupkey]; + if ( groupDetails === undefined ) { continue; } + if ( Object.keys(groupDetails.lists).length !== 0 ) { continue; } delete listTree[groupkey]; } @@ -707,7 +709,8 @@ dom.on('.searchbar input', 'input', searchFilterLists); /******************************************************************************/ const expandedListSet = new Set([ - 'uBlock filters', + 'cookies', + 'social', ]); const listIsExpanded = which => {