mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Add filesize check
This commit is contained in:
@ -54,7 +54,7 @@ class Stats(object):
|
|||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
with self._lock:
|
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)
|
core.log("[ai] loading %s" % self.path)
|
||||||
with open(self.path, 'rt') as fp:
|
with open(self.path, 'rt') as fp:
|
||||||
obj = json.load(fp)
|
obj = json.load(fp)
|
||||||
|
Reference in New Issue
Block a user