From 0fb3d39a0a6eb911985cd57412fe4d5b23e0bcb6 Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 1 Dec 2021 21:38:44 +0100 Subject: [PATCH] [core] Check if game is not-None before updating asset info --- legendary/core.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 69510f5..5877ac3 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -384,9 +384,15 @@ class LegendaryCore: self.log.info(f'Updating meta for {game.app_name} due to build version mismatch') eg_meta = self.egs.get_game_info(ga.namespace, ga.catalog_item_id) - game.asset_infos[platform] = ga + + if game: + asset_info = game.asset_infos + asset_info[platform] = ga + else: + asset_info = {platform: ga} + game = Game(app_name=ga.app_name, app_title=eg_meta['title'], metadata=eg_meta, - asset_infos=game.asset_infos) + asset_infos=asset_info) meta_updated = True self.lgd.set_game_meta(game.app_name, game)