diff --git a/src/digimarks/bookmarks_service.py b/src/digimarks/bookmarks_service.py index 6fa6814..5a42bbb 100644 --- a/src/digimarks/bookmarks_service.py +++ b/src/digimarks/bookmarks_service.py @@ -49,7 +49,8 @@ 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: - bookmark.title = html_content.title.text.strip() + 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)) raise HTTPException(status_code=400, detail='Error while trying to extract title')