From 6e1830875c4a31ac1621646c27e1c5b169221b01 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 13 Nov 2025 17:28:52 -0600 Subject: fix: add error handling for malformed timestamps in org-drill-entry-days-since-creation Wrapped org-time-stamp-to-now call in condition-case to gracefully handle malformed DATE_ADDED property values. Now returns nil instead of crashing when encountering invalid timestamp formats. Changes: - Added condition-case around org-time-stamp-to-now (lines 2896-2898) - Returns nil on error, allowing the function to fall through to other branches or return nil gracefully This prevents unhandled errors in long-running sessions when drill entries have corrupted or manually-edited timestamp values. --- org-drill.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org-drill.el b/org-drill.el index e1eea77..09e88b6 100644 --- a/org-drill.el +++ b/org-drill.el @@ -2893,7 +2893,9 @@ that many days)." (let ((timestamp (org-entry-get (point) "DATE_ADDED"))) (cond (timestamp - (- (org-time-stamp-to-now timestamp))) + (condition-case nil + (- (org-time-stamp-to-now timestamp)) + (error nil))) (use-last-interval-p (+ (or (org-drill-entry-days-overdue session) 0) (string-to-number (or (org-entry-get (point) "DRILL_LAST_INTERVAL") "0")))) -- cgit v1.2.3