From c014ceb12c7fb435172c96d8b7100138806eca16 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 24 Jul 2023 18:42:51 -0600 Subject: [PATCH] Fixed action queue --- thread.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thread.go b/thread.go index b342d24..dc85c86 100644 --- a/thread.go +++ b/thread.go @@ -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 {