[cli] sync-saves: Fix crash if metadata is missing

This commit is contained in:
derrod 2020-05-19 16:14:20 +02:00
parent 724ef4848c
commit 6278a21c77

View file

@ -252,7 +252,7 @@ class LegendaryCLI:
# evaluate current save state for each game. # evaluate current save state for each game.
for igame in igames: for igame in igames:
game = self.core.get_game(igame.app_name) game = self.core.get_game(igame.app_name)
if not game.supports_cloud_saves: if not game or not game.supports_cloud_saves:
if igame.app_name in latest_save: if igame.app_name in latest_save:
# this should never happen unless cloud save support was removed from a game # this should never happen unless cloud save support was removed from a game
logger.warning(f'{igame.app_name} has remote save(s) but does not support cloud saves?!') logger.warning(f'{igame.app_name} has remote save(s) but does not support cloud saves?!')