From d2d317ed341d536f3932bab5f5e32060ed2167a4 Mon Sep 17 00:00:00 2001 From: Edwin Henneken Date: Wed, 17 Mar 2021 06:01:45 -0400 Subject: [PATCH] small bugfix --- graphics_service/graphics.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/graphics_service/graphics.py b/graphics_service/graphics.py index a65d175..2222536 100644 --- a/graphics_service/graphics.py +++ b/graphics_service/graphics.py @@ -17,7 +17,11 @@ def get_graphics(bibcode): # Query graphics database with bibcode supplied results = get_graphics_record(bibcode) if results and 'thumbnails' in results: - if len(results['thumbnails']) == 0: + try: + thumbnail_count = len(results['thumbnails']) + except: + thumbnail_count = 0 + if thumbnail_count == 0: # No thumbnails = nothing to display return {'Error': 'Unable to get results!', 'Error Info': 'No thumbnail data for %s' % bibcode} output = {}