Skip to content

Commit 255c4b3

Browse files
author
Cimon Lucas (LCM)
committed
Avoid a CRITICAL error in case of <img> without src attribute
1 parent 5faba25 commit 255c4b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pelican/plugins/featured_image/featured_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def images_extraction(instance):
3030
if not featured_image:
3131
soup = BeautifulSoup(instance._content, "html.parser")
3232
imageTag = soup.find("img")
33-
if imageTag:
33+
if imageTag and 'src' in imageTag:
3434
featured_image = imageTag["src"]
3535

3636
# Set the attribute to content instance

0 commit comments

Comments
 (0)