From 05f387b42a6580f1c813adf575c60f270a4fcae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Sun, 11 Oct 2020 21:14:36 +0100 Subject: [PATCH] Added check for begin > finish time --- z/entry.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/z/entry.go b/z/entry.go index d02660e..0af8945 100644 --- a/z/entry.go +++ b/z/entry.go @@ -41,6 +41,10 @@ func NewEntry( } } + if finishTime.Before(beginTime) && finishTime.IsZero() == false { + return Entry{}, errors.New("Beginning time of tracking cannot be after the finish time!") + } + return Entry{ id, beginTime,