Fixed action queue

graph-rework-2
noah metz 2023-07-24 18:42:51 -06:00
parent aa960b9420
commit c014ceb12c
1 changed files with 2 additions and 1 deletions

@ -273,8 +273,9 @@ func (thread *Thread) SoonestAction() (*QueuedAction, <-chan time.Time) {
var soonest_action *QueuedAction
var soonest_time time.Time
for _, action := range(thread.ActionQueue) {
if action.Timeout.Compare(soonest_time) == -1 {
if action.Timeout.Compare(soonest_time) == -1 || soonest_action == nil {
soonest_action = &action
soonest_time = action.Timeout
}
}
if soonest_action != nil {