Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

fix src bug with images

Abi Rajaca00f5cc75bd
diff --git a/backend/image_generation/core.py b/backend/image_generation/core.py
index b67759f3..8ac9d35c 100644
--- a/backend/image_generation/core.py
+++ b/backend/image_generation/core.py
@@ -110,7 +110,7 @@ async def generate_images(
# Only include URL if the image starts with https://placehold.co
# and it's not already in the image_cache
if (
- "src" in img
+ img.get("src", None)
and img["src"].startswith("https://placehold.co")
and image_cache.get(img.get("alt")) is None
):