From 19c6c55b465debe976c0914bac69974ce919a455 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 23 Apr 2023 10:18:20 +0100 Subject: [PATCH] Check for string type --- webapp_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webapp_utils.py b/webapp_utils.py index f4e0b3ba1..ca1fd419a 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -2233,10 +2233,11 @@ def get_buy_links(post_json_object: str, translate: {}, buy_sites: {}) -> {}: ' ' in item['href']: continue if item.get('rel'): - if item['rel'] in ('payment', 'donate', 'donation', - 'buy', 'purchase'): - links[item_name] = item['href'] - continue + if isinstance(item['rel'], str): + if item['rel'] in ('payment', 'donate', 'donation', + 'buy', 'purchase'): + links[item_name] = item['href'] + continue if buy_sites: # limited to an allowlist of buying sites for site, buy_domain in buy_sites.items():