Guard aginst empty platform

This commit is contained in:
fanyx 2023-08-31 13:40:42 +02:00
parent f98e44d3c7
commit 4e994dd56a
1 changed files with 2 additions and 2 deletions

View File

@ -107,8 +107,8 @@ def build_table(index, games):
# actual game text
for game in games:
name = game['name']
platform = game['platform']
name = game.get('name')
platform = game.get('platform', '')
if len(platform) > MAX_WIDTH_PLATFORM:
raise Exception(f"Platform shortcode for {name} is longer than {MAX_WIDTH_PLATFORM} characters. Invalid.")