1
0
mirror of https://codeberg.org/diginaut/digimarks.git synced 2026-06-21 01:57:27 +02:00

Guard against None value

This commit is contained in:
2026-05-19 20:00:27 +02:00
parent 39f4b43b7f
commit ec47066d41
+1
View File
@@ -49,6 +49,7 @@ async def set_information_from_source(bookmark: Bookmark, request: Request) -> B
if bookmark.http_status == 200 or bookmark.http_status == 202:
html_content = bs4.BeautifulSoup(result.text, 'html.parser')
try:
if html_content.title:
bookmark.title = html_content.title.text.strip()
except AttributeError as exc:
logger.error('Error while trying to extract title from URL %s: %s', str(bookmark.url), str(exc))