From 6ccb5f537ce33c3bb1a9cc60e12ae8fa98543394 Mon Sep 17 00:00:00 2001 From: DUO Labs Date: Thu, 10 Feb 2022 17:57:16 -0500 Subject: [PATCH] Fix error with `remove_site_blocks` in the Images tab --- app/filter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/filter.py b/app/filter.py index 66cced7..42935c2 100644 --- a/app/filter.py +++ b/app/filter.py @@ -125,6 +125,9 @@ class Filter: def remove_site_blocks(self, soup) -> None: if not self.config.block: return + + if not soup.body: + return search_string = ' '.join(['-site:' + _ for _ in self.config.block.split(',')]) selected = soup.body.findAll(text=re.compile(search_string))