From 4841c79b4c22e0bc5b32093c9f752aa11262304d Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 14 Jun 2022 19:54:35 +0200 Subject: [PATCH] Adding extra check when updating DB on ReplyWithContentButNoText --- changedetectionio/update_worker.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/changedetectionio/update_worker.py b/changedetectionio/update_worker.py index 138a5435..b72b21ca 100644 --- a/changedetectionio/update_worker.py +++ b/changedetectionio/update_worker.py @@ -45,7 +45,6 @@ class update_worker(threading.Thread): try: changed_detected, update_obj, contents, screenshot, xpath_data = update_handler.run(uuid) - # Re #342 # In Python 3, all strings are sequences of Unicode characters. There is a bytes type that holds raw bytes. # We then convert/.decode('utf-8') for the notification etc @@ -56,7 +55,7 @@ class update_worker(threading.Thread): except content_fetcher.ReplyWithContentButNoText as e: # Totally fine, it's by choice - just continue on, nothing more to care about # Page had elements/content but no renderable text - if self.datastore.data['watching'][uuid].get('css_filter'): + if self.datastore.data['watching'].get(uuid, False) and self.datastore.data['watching'][uuid].get('css_filter'): self.datastore.update_watch(uuid=uuid, update_obj={'last_error': "Got HTML content but no text found (CSS / xPath Filter not found in page?)"}) else: self.datastore.update_watch(uuid=uuid, update_obj={'last_error': "Got HTML content but no text found."})