From 5a38f5463669feb19cee89648523f9e5c4b4354a Mon Sep 17 00:00:00 2001 From: kevin olson Date: Fri, 10 May 2024 19:32:30 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=BA=20make=20sure=20program=20isnt=20n?= =?UTF-8?q?il?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taskin.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/taskin.go b/taskin.go index 249d498..3ea6748 100644 --- a/taskin.go +++ b/taskin.go @@ -77,7 +77,9 @@ func New(tasks Tasks, cfg Config) Runners { if err != nil { runners[i].Task.Title = fmt.Sprintf("%s - Error: %s", runners[i].Task.Title, err.Error()) runners[i].State = Failed - program.Send(spinner.TickMsg{}) + if program != nil { + program.Send(spinner.TickMsg{}) + } continue } @@ -89,7 +91,9 @@ func New(tasks Tasks, cfg Config) Runners { runners[i].Children[j].Task.Title = fmt.Sprintf("%s - Error: %s", runners[i].Children[j].Task.Title, err.Error()) runners[i].Children[j].State = Failed runners[i].State = Failed // Mark parent task as Failed - program.Send(spinner.TickMsg{}) + if program != nil { + program.Send(spinner.TickMsg{}) + } break } runners[i].Children[j].State = Completed @@ -107,7 +111,9 @@ func New(tasks Tasks, cfg Config) Runners { // If all child tasks are completed, mark the parent task as completed if allChildrenCompleted && runners[i].State != Failed { runners[i].State = Completed - program.Send(spinner.TickMsg{}) + if program != nil { + program.Send(spinner.TickMsg{}) + } } } }()