fix: execOnCalendarFile, avoid possible crash deleting nil timers

This commit is contained in:
jamesread 2026-01-21 23:12:39 +00:00
parent 56786491e8
commit b3430e3a5c
1 changed files with 4 additions and 1 deletions

View File

@ -132,7 +132,10 @@ func registerTimer(action *config.Action, instant time.Time, timer *time.Timer,
func unregisterTimer(action *config.Action, instant time.Time) {
scheduleMapMutex.Lock()
delete(scheduleMap[action.ID].timers, instant)
v := scheduleMap[action.ID]
if v.timers != nil {
delete(v.timers, instant)
}
scheduleMapMutex.Unlock()
}