diff --git a/timebot.py b/timebot.py index f3318fb..78d1e3c 100644 --- a/timebot.py +++ b/timebot.py @@ -273,7 +273,7 @@ class TimeBot: def smart_punch(self, punch_datetime): last_punch = tb.mobatime_api.get_entries(1, punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0)) method = None - if not last_punch: + if not last_punch or last_punch[0]["entryNumber"] is None: logger.debug("could not detect any time entry for today... punching in") method = "punch_in" elif last_punch[0]["entryNumber"] == COMING_ENTRY_CODE_ID: