From 6ba5fdad6101ecb519ffffae6eec66552201d664 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 29 Jan 2021 17:36:21 +0100 Subject: [PATCH] Fix bug in agenda effort summation if nothing there to display --- site-lisp/db-org.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 9e0dc67..232f859 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -212,7 +212,11 @@ Add this function to `org-agenda-finalize-hook'." (insert-and-inherit (concat " (" (db/org-agenda-calculate-efforts - (next-single-property-change (point) 'day)) + (or (next-single-property-change (point) 'day) + ;; If nothing is shown on the current day, the previous + ;; call may return nil; in that case, don't sum anything + ;; by setting the limit to 0 + 0)) ")")) (forward-line)))))