From 8d3a3cc7f07d412d762ec25955674584d6587b80 Mon Sep 17 00:00:00 2001
From: "Azalea (on HyDEV-Daisy)" <me@hydev.org>
Date: Mon, 25 Jul 2022 20:43:52 -0400
Subject: [PATCH] [F] Fix config upgrade error

---
 hyfetch/main.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hyfetch/main.py b/hyfetch/main.py
index 0cf87db7..47d7ba13 100755
--- a/hyfetch/main.py
+++ b/hyfetch/main.py
@@ -27,7 +27,10 @@ def check_config() -> Config:
     :return: Config object
     """
     if CONFIG_PATH.is_file():
-        return Config.from_dict(json.loads(CONFIG_PATH.read_text('utf-8')))
+        try:
+            return Config.from_dict(json.loads(CONFIG_PATH.read_text('utf-8')))
+        except KeyError:
+            return create_config()
 
     return create_config()