From 3459213765186bdc7f4a0d76354eb7e12728492e Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 18 Nov 2018 16:00:13 +0100 Subject: [PATCH] =?UTF-8?q?[Org]=20Add=20simple=20check=20for=20=E2=80=98d?= =?UTF-8?q?b/clock-in-by-task-id=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site-lisp/db-org.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 2d0a3e0..4abea3d 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -318,9 +318,12 @@ In ~%s~: (defun db/clock-in-task-by-id (task-id) "Clock in org mode task as given by TASK-ID." - (org-with-point-at (org-id-find task-id 'marker) - (org-clock-in)) - (org-save-all-org-buffers)) + (let ((location (org-id-find task-id 'marker))) + (if (null location) + (user-error "Invalid location «%s» given." task-id) + (org-with-point-at location + (org-clock-in)) + (org-save-all-org-buffers)))) (defun db/clock-out-task-by-id (task-id) "Clock out org mode task as given by TASK-ID."