Fix not returning default on nonexistant file
This commit is contained in:
parent
fa0451a525
commit
d0ce13cebc
1 changed files with 2 additions and 0 deletions
2
main.py
2
main.py
|
@ -35,6 +35,8 @@ def load_data(path, default={}):
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
except json.decoder.JSONDecodeError:
|
except json.decoder.JSONDecodeError:
|
||||||
return default
|
return default
|
||||||
|
else:
|
||||||
|
return default
|
||||||
|
|
||||||
# Cache for files sent to the homeserver, prevents reuploading existing files
|
# Cache for files sent to the homeserver, prevents reuploading existing files
|
||||||
file_cache = load_data(settings["file_cache_path"])
|
file_cache = load_data(settings["file_cache_path"])
|
||||||
|
|
Loading…
Reference in a new issue