Fix issue where stop could stopped already stopped timers

This commit is contained in:
Brian Buller 2018-04-11 08:45:48 -05:00
parent 35d6d035fa
commit f0c8bcb408
2 changed files with 4 additions and 4 deletions

2
Godeps/Godeps.json generated
View File

@ -1,6 +1,6 @@
{ {
"ImportPath": "git.bullercodeworks.com/brian/gime", "ImportPath": "git.bullercodeworks.com/brian/gime",
"GoVersion": "go1.9", "GoVersion": "go1.10",
"GodepVersion": "v79", "GodepVersion": "v79",
"Deps": [ "Deps": [
{ {

View File

@ -112,9 +112,9 @@ func cmdStopTimer(args []string) int {
fmt.Println("Error parsing timer id:", err.Error()) fmt.Println("Error parsing timer id:", err.Error())
return 1 return 1
} }
tmr, _, err = findTimerById(timerId) tmr = actTimers.Get(timerId)
if err != nil { if timerId >= actTimers.Length() || timerId < 0 || tmr == nil {
fmt.Println(err.Error()) fmt.Println("Error finding timer with id:", timerId)
return 1 return 1
} }
} }