forked from Minecraft/minecraft_manager
Protect stats from corrupted files
parent
6d6538664e
commit
caa7463b70
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue