Skip to content

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

Python

fix src bug

Abi Raja5b3317679e84
diff --git a/backend/image_generation/core.py b/backend/image_generation/core.py
index cff890cb..b67759f3 100644
--- a/backend/image_generation/core.py
+++ b/backend/image_generation/core.py
@@ -110,7 +110,8 @@ 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 (
- img["src"].startswith("https://placehold.co")
+ "src" in img
+ and img["src"].startswith("https://placehold.co")
and image_cache.get(img.get("alt")) is None
):
alts.append(img.get("alt", None))