Exception for load config

This commit is contained in:
Lasse Studion 2022-12-18 09:05:18 +01:00
parent 36a112a1dd
commit d7a0c4045d

View File

@ -62,7 +62,10 @@ def get_config(check_for=False):
# Returns a config file, creating one if not existing.
if os.path.exists("config.json"):
with open("config.json") as f:
try:
config = json.load(f)
except json.decoder.JSONDecodeError:
config = create_config()
if check_for:
for i in check_for:
if i not in config: