Skip to content

Commit

Permalink
Fix: Edge case where amount is blank in log from default write.
Browse files Browse the repository at this point in the history
  • Loading branch information
wakatara committed Feb 6, 2024
1 parent 7c165a7 commit 49e7d94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions harsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 49e7d94

Please sign in to comment.