Add filesize check

This commit is contained in:
dadav 2019-09-29 19:44:31 +02:00
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)