From a546be7f53fc448adf7c6519deb460f232054750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9=20=D0=9F=D1=83?= =?UTF-8?q?=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Mon, 15 Jul 2019 16:08:57 +0300 Subject: [PATCH] Fix last task handling --- worktimer.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/worktimer.scm b/worktimer.scm index 503b8fd..002d082 100755 --- a/worktimer.scm +++ b/worktimer.scm @@ -659,7 +659,7 @@ "Not specified task path. No tasks in the sheet.\n") (values #f #f #f)) (begin - (stop-task last) + (when last (stop-task last)) (let-values (((sheet task) (new-task sheet path))) (format #t "--- NEW TASK RUN\n") (print-timerecord task) @@ -668,7 +668,7 @@ ;;; Stop a running task. Returns new sheet or #f if nothing to stop. (define (cmd-stop-task sheet deadlines archives . params) (let ((last (last-task sheet))) - (if (stop-task last) + (if (and last (stop-task last)) (begin (format #t "--- STOP TASK\n") (print-timerecord last) @@ -761,7 +761,7 @@ (lambda (break-del) (let ((task (if arg1 (path-split arg1) - (if (null? last) + (if (not last) (begin (format #t "Not specified task path.\n") (break-del #f)) (car last))))) (fold-right @@ -784,7 +784,7 @@ (else (let ((task (if arg0 (path-split arg0) - (if (null? last) + (if (not last) (begin (format #t "--- ALL DEADLINES\n") `()) (car last))))) (for-each