Check event is initialized before delete; fixes crash reported by

Michael Nickerson in GitHub issue 1068.
This commit is contained in:
nicm 2017-09-11 20:11:45 +00:00
parent d8d6c2746e
commit af2c7ce646

View File

@ -142,7 +142,8 @@ alerts_reset(struct window *w)
struct timeval tv; struct timeval tv;
w->flags &= ~WINDOW_SILENCE; w->flags &= ~WINDOW_SILENCE;
event_del(&w->alerts_timer); if (event_initialized(&w->alerts_timer))
event_del(&w->alerts_timer);
timerclear(&tv); timerclear(&tv);
tv.tv_sec = options_get_number(w->options, "monitor-silence"); tv.tv_sec = options_get_number(w->options, "monitor-silence");