Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit 50a6248

Browse files
Rana KoltaRana Kolta
authored andcommitted
Fixing Errors for no Image URL in the List View. Google Actions returns -The protocol must be http or https- for empty image urls
1 parent 9331b97 commit 50a6248

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

flask_assistant/response.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,12 @@ def build_item(
206206
"info": {"key": key or title, "synonyms": synonyms or []},
207207
"title": title,
208208
"description": description,
209-
"image": {
210-
"imageUri": img_url or "",
211-
"accessibilityText": alt_text or "{} img".format(title),
212-
},
213209
}
210+
211+
if img_url:
212+
img_payload = {"imageUri": img_url, "accessibilityText": alt_text or "{} img".format(title)}
213+
item["image"] = img_payload
214+
214215
return item
215216

216217

0 commit comments

Comments
 (0)