[core] Reset EGL path if it is invalid

This commit is contained in:
derrod 2020-05-29 23:52:26 +02:00
parent b027bade1c
commit 99485da7d8

View file

@ -53,6 +53,9 @@ class LegendaryCore:
# on non-Windows load the programdata path from config
if os.name != 'nt':
self.egl.programdata_path = self.lgd.config.get('Legendary', 'egl_programdata', fallback=None)
if self.egl.programdata_path and not os.path.exists(self.egl.programdata_path):
self.log.error(f'Config EGL ProgramData path ("{self.egl.programdata_path}") is invalid! Please fix.')
self.egl.programdata_path = None
self.local_timezone = datetime.now().astimezone().tzinfo
self.language_code, self.country_code = ('en', 'US')