Updated TimerList struct
This commit is contained in:
@@ -42,8 +42,9 @@ func opMod(cmd *cobra.Command, args []string) error {
|
||||
id, err := strconv.Atoi(args[0])
|
||||
if err != nil {
|
||||
// We didn't have a timer id, so try to modify the first active timer
|
||||
if len(*p.TimerList.GetActiveTimers()) > 0 {
|
||||
timer = (*p.TimerList.GetActiveTimers())[0]
|
||||
active := p.TimerList.GetActiveTimers().GetTimerSlice()
|
||||
if len(active) > 0 {
|
||||
timer = active[0]
|
||||
} else {
|
||||
// And we don't have any active timers
|
||||
return fmt.Errorf("No active timers, 'id' must be provided: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user