From d7a0c4045d47b2828d2b46f0588ac1e91344e907 Mon Sep 17 00:00:00 2001 From: Lasse Studion Date: Sun, 18 Dec 2022 09:05:18 +0100 Subject: [PATCH] Exception for load config --- config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 72eee5b..00824e5 100644 --- a/config.py +++ b/config.py @@ -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: - config = json.load(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: