diff --git a/src/yolov7_reid/src/telegram_bot.py b/src/yolov7_reid/src/telegram_bot.py index 5e2af86c..566c701a 100644 --- a/src/yolov7_reid/src/telegram_bot.py +++ b/src/yolov7_reid/src/telegram_bot.py @@ -82,10 +82,9 @@ def save_id(self,chat_id): with open(self.chat_id_filepath, "w") as f: f.write(chat_id) def load_id(self): - if os.path.exists(self.chat_id_filepath): + if os.path.exists(self.chat_id_filepath) and chat_id == '': with open(self.chat_id_filepath,'r') as f: chat_id = f.readline() - if chat_id == '': - return None + return None return chat_id - return None \ No newline at end of file + return None