Check if manifests path exists before iterating over them

This commit is contained in:
Mathieu Comandon 2021-08-09 18:51:35 -07:00
parent 04697e8fd5
commit 8f44cc1b30

View file

@ -2,6 +2,8 @@
import json
import os
from lutris.util.log import logger
class EGSLauncher:
manifests_paths = 'ProgramData/Epic/EpicGamesLauncher/Data/Manifests'
@ -11,6 +13,9 @@ class EGSLauncher:
def iter_manifests(self):
manifests_path = os.path.join(self.prefix_path, 'drive_c', self.manifests_paths)
if not os.path.exists(manifests_path):
logger.warning("No valid path for EGS games manifests in %s", manifests_path)
return
for manifest in os.listdir(manifests_path):
if not manifest.endswith(".item"):
continue