diff --git a/ckanext/textpreview/plugin.py b/ckanext/textpreview/plugin.py index 407fa52d7c9..32209d2cb98 100644 --- a/ckanext/textpreview/plugin.py +++ b/ckanext/textpreview/plugin.py @@ -63,7 +63,7 @@ def configure(self, config): def can_preview(self, data_dict): resource = data_dict['resource'] - format_lower = resource['format'].lower() + format_lower = resource.get('format', '').lower() quality = QUALITY.get(format_lower, 1)