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",
"GoVersion": "go1.9",
"GoVersion": "go1.10",
"GodepVersion": "v79",
"Deps": [
{

View File

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