[lfs] Ensure "Legendary" config section exists

Fixes #50
This commit is contained in:
derrod 2020-05-30 21:15:13 +02:00
parent f05fb2a76c
commit 10cf1f7c00

View file

@ -37,6 +37,9 @@ class LGDLFS:
# try loading config # try loading config
self.config.read(os.path.join(self.path, 'config.ini')) self.config.read(os.path.join(self.path, 'config.ini'))
# make sure "Legendary" section exists
if 'Legendary' not in self.config:
self.config['Legendary'] = dict()
try: try:
self._installed = json.load(open(os.path.join(self.path, 'installed.json'))) self._installed = json.load(open(os.path.join(self.path, 'installed.json')))