mirror of
https://github.com/lutris/lutris
synced 2024-09-30 04:54:18 +00:00
Merge pull request #5423 from CKolle/bug_fix_proton_env
Fix NoneType error in get_game_id function
This commit is contained in:
commit
051908f686
|
@ -100,14 +100,22 @@ def get_proton_path_from_bin(wine_path):
|
|||
|
||||
|
||||
def get_game_id(game) -> str:
|
||||
games_path = os.path.join(settings.RUNTIME_DIR, "umu-games/umu-games.json")
|
||||
env = game.runner.get_env()
|
||||
if game and env.get("GAMEID") or env.get("UMU_ID"):
|
||||
return env.get("GAMEID") or env.get("UMU_ID")
|
||||
if not os.path.exists(games_path) or not game:
|
||||
if not game:
|
||||
return DEFAULT_GAMEID
|
||||
|
||||
envs = game.runner.get_env()
|
||||
game_id = envs.get("GAMEID") or envs.get("UMU_ID")
|
||||
if game_id:
|
||||
return game_id
|
||||
|
||||
games_path = os.path.join(settings.RUNTIME_DIR, "umu-games/umu-games.json")
|
||||
|
||||
if not os.path.exists(games_path):
|
||||
return DEFAULT_GAMEID
|
||||
|
||||
with open(games_path, "r", encoding="utf-8") as games_file:
|
||||
umu_games = json.load(games_file)
|
||||
|
||||
for umu_game in umu_games:
|
||||
if (
|
||||
umu_game["store"]
|
||||
|
|
Loading…
Reference in a new issue