Protect stats from corrupted files

reminder
Etzelia 2019-01-07 05:18:37 +01:00
parent 6d6538664e
commit caa7463b70
1 changed files with 4 additions and 1 deletions

5
external/stats.py vendored
View File

@ -14,7 +14,10 @@ def get_stats():
stats = {}
for filename in os.listdir(stats_dir):
with open(stats_dir + "/" + filename) as json_file:
raw = json.load(json_file)['stats']
try:
raw = json.load(json_file)['stats']
except:
continue
clean = {}
raw_copy = copy.deepcopy(raw)
for ra in raw_copy: