fix: execOnCalendarFile, avoid possible crash deleting nil timers
This commit is contained in:
parent
56786491e8
commit
b3430e3a5c
|
|
@ -132,7 +132,10 @@ func registerTimer(action *config.Action, instant time.Time, timer *time.Timer,
|
||||||
|
|
||||||
func unregisterTimer(action *config.Action, instant time.Time) {
|
func unregisterTimer(action *config.Action, instant time.Time) {
|
||||||
scheduleMapMutex.Lock()
|
scheduleMapMutex.Lock()
|
||||||
delete(scheduleMap[action.ID].timers, instant)
|
v := scheduleMap[action.ID]
|
||||||
|
if v.timers != nil {
|
||||||
|
delete(v.timers, instant)
|
||||||
|
}
|
||||||
scheduleMapMutex.Unlock()
|
scheduleMapMutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue