branch: master
commit 1f8935e117918fab8c6ad700b627a67ac4a4f10c
Author: Ian Dunn <du...@gnu.org>
Commit: Ian Dunn <du...@gnu.org>

    Catch non-existent timestamps in planning action
    
    * org-edna.el (org-edna--handle-planning): Throw an error if the source
      timestamp doesn't exist.
---
 org-edna.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/org-edna.el b/org-edna.el
index 01f13c3..f14bcc7 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1195,6 +1195,9 @@ forward) or the last day of MONTH (backward)."
       (pcase-let* ((`(,n ,what-string ,def) (org-edna--read-date-get-relative 
arg this-time current))
                    (ts (if def current-ts this-ts))
                    (what (cdr (assoc-string what-string type-map))))
+        ;; Ensure that the source timestamp exists
+        (unless ts
+          (error "Tried to increment a non-existent timestamp"))
         (org--deadline-or-schedule nil type (org-edna--mod-timestamp ts n 
what))))
      (t
       ;; For everything else, assume `org-read-date-analyze' can handle it

Reply via email to