From e78724653af111ea61ee7e327b86672415b674b4 Mon Sep 17 00:00:00 2001 From: Rick Moynihan Date: Fri, 4 Oct 2024 11:00:51 +0100 Subject: [PATCH] Fix #131 pages break whole site when an tag has no src attr --- ckanext/pages/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/pages/actions.py b/ckanext/pages/actions.py index 9778f520..461d172b 100644 --- a/ckanext/pages/actions.py +++ b/ckanext/pages/actions.py @@ -23,7 +23,7 @@ def __init__(self): def handle_starttag(self, tag, attrs): if tag == 'img' and not self.first_image: - self.first_image = dict(attrs)['src'] + self.first_image = dict(attrs).get('src') def _pages_show(context, data_dict):