mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-13 20:14:12 +02:00
Fix panic when no timers are left after dispatch
This commit is contained in:
@@ -325,9 +325,12 @@ func (self *Loop) run() (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
timeout := self.timers[0].deadline.Sub(now)
|
||||
if timeout < 0 {
|
||||
timeout = 0
|
||||
var timeout time.Duration
|
||||
if len(self.timers) > 0 {
|
||||
timeout = self.timers[0].deadline.Sub(now)
|
||||
if timeout < 0 {
|
||||
timeout = 0
|
||||
}
|
||||
}
|
||||
timeout_chan = time.After(timeout)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user