Add filesize check
This commit is contained in:
parent
000e11869f
commit
e35a64734f
@ -54,7 +54,7 @@ class Stats(object):
|
||||
|
||||
def load(self):
|
||||
with self._lock:
|
||||
if os.path.exists(self.path):
|
||||
if os.path.exists(self.path) and os.path.getsize(self.path) > 0:
|
||||
core.log("[ai] loading %s" % self.path)
|
||||
with open(self.path, 'rt') as fp:
|
||||
obj = json.load(fp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user