Don't throw error if CLI config is missing keys

This commit is contained in:
Tulir Asokan 2020-04-28 17:37:28 +03:00
parent 6b5dedb29f
commit 98eeb6a808

View file

@ -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