aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-13 17:28:52 -0600
committerCraig Jennings <c@cjennings.net>2025-11-13 17:28:52 -0600
commit6e1830875c4a31ac1621646c27e1c5b169221b01 (patch)
tree84724c17a23db10bfe0acb1f235b5b850199ef85
parent1d00ec2fa328878e62f4050097fd44b4425e195f (diff)
downloadorg-drill-6e1830875c4a31ac1621646c27e1c5b169221b01.tar.gz
org-drill-6e1830875c4a31ac1621646c27e1c5b169221b01.zip
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.
-rw-r--r--org-drill.el4
1 files changed, 3 insertions, 1 deletions
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"))))