Skip to content

Commit ba6ed8c

Browse files
committed
don't try to add empty url buttons
1 parent ed67ddb commit ba6ed8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

formatters.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def format_links(brief_stores: List[StoreBrief], stores: List[Store]) -> InlineK
8686
store_names[brief_store.id] = brief_store.name
8787

8888
for store in stores:
89+
# apparently some urls may be empty, resulting in exception.
90+
if store.url is None or store.url == '':
91+
continue
8992
button = InlineKeyboardButton(text=store_names[store.store_id], url=store.url.replace('http://', 'https://'))
9093
store_buttons.append([button])
9194

0 commit comments

Comments
 (0)