diff --git a/workflow/workflow.go b/workflow/workflow.go index 57f4922..fc9f333 100644 --- a/workflow/workflow.go +++ b/workflow/workflow.go @@ -253,7 +253,13 @@ func (e *executableWorkflow) Execute(ctx context.Context, serializedInput any) ( return "", nil, lastErrors case <-timedContext.Done(): lastErrors := l.handleErrors() - return "", nil, fmt.Errorf("workflow execution aborted (%w) (%s)", ctx.Err(), lastErrors.Error()) + var errMsg string + if lastErrors == nil { + errMsg = "" + } else { + errMsg = lastErrors.Error() + } + return "", nil, fmt.Errorf("workflow execution aborted (%w) (%s)", ctx.Err(), errMsg) } }