From 49e7d9429d4e824461b89c4cc044e86c990f0675 Mon Sep 17 00:00:00 2001 From: Daryl Manning Date: Tue, 6 Feb 2024 13:42:18 +0800 Subject: [PATCH] Fix: Edge case where amount is blank in log from default write. --- harsh.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/harsh.go b/harsh.go index 155e0f5..fad875a 100755 --- a/harsh.go +++ b/harsh.go @@ -660,6 +660,9 @@ func loadLog(configDir string) *Entries { } switch len(result) { case 5: + if result[4] == "" { + result[4] = "0" + } amount, err := strconv.ParseFloat(result[4], 64) if err != nil { fmt.Println("Error: there is a non-number in your log file where we expect a number.")