From fcb213e05828a200a5d6481f8213f46617f5c28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 26 Nov 2024 09:30:47 -0500 Subject: [PATCH] Avoid crashing and burning if no prior recorded time --- settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/settings.py b/settings.py index c51fcd6..4e8a66e 100644 --- a/settings.py +++ b/settings.py @@ -37,7 +37,8 @@ def pomodoro_logpath(): def pomodoro_latest_recorded(timestamp = None): 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)) write() else: