Don't throw error if CLI config is missing keys
This commit is contained in:
parent
6b5dedb29f
commit
98eeb6a808
1 changed files with 3 additions and 3 deletions
|
@ -70,8 +70,8 @@ def load_config() -> None:
|
||||||
try:
|
try:
|
||||||
with open(f"{configdir}/maubot-cli.json") as file:
|
with open(f"{configdir}/maubot-cli.json") as file:
|
||||||
loaded = json.load(file)
|
loaded = json.load(file)
|
||||||
config["servers"] = loaded["servers"]
|
config["servers"] = loaded.get("servers", {})
|
||||||
config["aliases"] = loaded["aliases"]
|
config["aliases"] = loaded.get("aliases", {})
|
||||||
config["default_server"] = loaded["default_server"]
|
config["default_server"] = loaded.get("default_server", None)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue