Avoid crashing and burning if no prior recorded time

This commit is contained in:
benjamin melançon 2024-11-26 09:30:47 -05:00
parent 72b39bc00c
commit fcb213e058

View file

@ -37,7 +37,8 @@ def pomodoro_logpath():
def pomodoro_latest_recorded(timestamp = None): def pomodoro_latest_recorded(timestamp = None):
if timestamp: if timestamp:
config.set('pomodoro', 'second_latest_recorded', pomodoro.get('latest_recorded', None)) if pomodoro.get('latest_recorded', None):
config.set('pomodoro', 'second_latest_recorded', pomodoro.get('latest_recorded'))
config.set('pomodoro', 'latest_recorded', str(timestamp)) config.set('pomodoro', 'latest_recorded', str(timestamp))
write() write()
else: else: