Skip to content

Commit b32cbfe

Browse files
committed
handling for null thumbnails
1 parent d456f86 commit b32cbfe

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pythia-gallery.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ def render_resource(resource: dict):
3737

3838
#if "thumbnail" in resource:
3939
#else:
40-
try:
41-
thumbnail = resource['thumbnail']
42-
except:
43-
thumbnail = "_static/thumbnails/ProjectPythia_Blue.png"
40+
thumbnail = resource.get('thumbnail') or "_static/thumbnails/ProjectPythia_Blue.png"
4441

4542
# Build tags
4643
tags = resource["tags"]

0 commit comments

Comments
 (0)