From 98eeb6a808b49e90b31199c7dbb5ed55e641ce43 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 28 Apr 2020 17:37:28 +0300 Subject: [PATCH] Don't throw error if CLI config is missing keys --- maubot/cli/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maubot/cli/config.py b/maubot/cli/config.py index 4fd5c2b..550c326 100644 --- a/maubot/cli/config.py +++ b/maubot/cli/config.py @@ -70,8 +70,8 @@ def load_config() -> None: try: with open(f"{configdir}/maubot-cli.json") as file: loaded = json.load(file) - config["servers"] = loaded["servers"] - config["aliases"] = loaded["aliases"] - config["default_server"] = loaded["default_server"] + config["servers"] = loaded.get("servers", {}) + config["aliases"] = loaded.get("aliases", {}) + config["default_server"] = loaded.get("default_server", None) except FileNotFoundError: pass