Skip to content

Commit

Permalink
Ubisoft YAML search should return its (None, None) signal value if an…
Browse files Browse the repository at this point in the history
…y of the various keys or indices it looks for are missing.

Resolves #5469
  • Loading branch information
danieljohnson2 committed May 11, 2024
1 parent 80fdb19 commit 28e5d2e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lutris/util/ubisoft/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,15 @@ def _get_steam_game_properties_from_yaml(self, game_yaml):
return path, third_party_id

def _get_registry_properties_from_yaml(self, game_yaml):
game_registry_path = ""
exe = ""
if "online" not in game_yaml["root"]["start_game"]:
return None, None
registry_path = game_yaml["root"]["start_game"]["online"]["executables"][0]["working_directory"]["register"]
game_registry_path = registry_path
try:
exe = game_yaml["root"]["start_game"]["online"]["executables"][0]["path"]["relative"]
except KeyError:
exe = game_yaml["root"]["start_game"]["online"]["executables"][0]["path"]["register"]
return game_registry_path, exe
registry_path = game_yaml["root"]["start_game"]["online"]["executables"][0]["working_directory"]["register"]
try:
exe = game_yaml["root"]["start_game"]["online"]["executables"][0]["path"]["relative"]
except KeyError:
exe = game_yaml["root"]["start_game"]["online"]["executables"][0]["path"]["register"]
return registry_path, exe
except (KeyError, IndexError):
return None, None

def _parse_game(self, game_yaml, install_id, launch_id):
space_id = ""
Expand Down

0 comments on commit 28e5d2e

Please sign in to comment.