From 5fd70815c13f93f9ef4d97b8f9746153d281503b Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 21 Aug 2024 16:35:29 -0300 Subject: [PATCH] fix: nil err Signed-off-by: Carlos Alexandro Becker --- form.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/form.go b/form.go index eee47fe3..17679cda 100644 --- a/form.go +++ b/form.go @@ -652,7 +652,10 @@ func (f *Form) run(ctx context.Context) error { if errors.Is(err, tea.ErrProgramKilled) { return ErrTimeout } - return fmt.Errorf("huh: %w", err) + if err != nil { + return fmt.Errorf("huh: %w", err) + } + return nil } // runAccessible runs the form in accessible mode.