From 1fffd417832d54273cf4554445407ce3f89c9041 Mon Sep 17 00:00:00 2001 From: Marcos Marado Date: Wed, 13 Sep 2023 15:38:08 +0000 Subject: [PATCH] Check if the save file isn't corrupted If the save file is empty, then it will not be loadable, and it is best act as if none existed. --- botany.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botany.py b/botany.py index 1f17b16..007d4a4 100755 --- a/botany.py +++ b/botany.py @@ -393,7 +393,7 @@ class DataManager(object): def check_plant(self): # check for existing save file - if os.path.isfile(self.savefile_path): + if os.path.isfile(self.savefile_path) and os.path.getsize(self.savefile_path) > 0: return True else: return False