Check for empty list when activating Origin games

Prevents `IndexError` from occurring when Origin games list is empty.
This commit is contained in:
tooru 2022-02-23 00:36:27 +02:00 committed by GitHub
parent d7360eef3e
commit ebd59cee91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2005,6 +2005,10 @@ class LegendaryCLI:
na_games, _ = self.core.get_non_asset_library_items(skip_ue=True)
origin_games = [game for game in na_games if game.third_party_store == 'Origin']
if not origin_games:
logger.info('No redeemable games found.')
return
logger.info(f'Found {len(origin_games)} game(s) to redeem:')
for game in origin_games:
logger.info(f' - {game.app_title}')