From 496bda3345b45028818935b4da2004c6ddf246f0 Mon Sep 17 00:00:00 2001 From: tooru Date: Fri, 24 Jun 2022 13:08:54 +0300 Subject: [PATCH] [cli] Check for empty list when activating Origin games Prevents `IndexError` from occurring when Origin games list is empty. --- legendary/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/legendary/cli.py b/legendary/cli.py index 6c1786e..f389b75 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -2013,6 +2013,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}')