[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1f8935e 2/3: Catch non-existent timestamps in planning act
From: |
Ian Dunn |
Subject: |
[elpa] master 1f8935e 2/3: Catch non-existent timestamps in planning action |
Date: |
Sun, 17 Dec 2017 20:44:31 -0500 (EST) |
branch: master
commit 1f8935e117918fab8c6ad700b627a67ac4a4f10c
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
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