Skip to content

Commit

Permalink
flow: fix empty template.xxx in flow (#5106)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunKoyalwar authored Apr 25, 2024
1 parent 295f458 commit 7ce1b3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/tmplexec/flow/flow_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ func (f *FlowExecutor) ExecuteWithResults(ctx *scan.ScanContext) error {
}
}
// register template object
if err := runtime.Set("template", f.options.GetTemplateCtx(f.ctx.Input.MetaInput).GetAll()); err != nil {
tmplObj := f.options.GetTemplateCtx(f.ctx.Input.MetaInput).GetAll()
if tmplObj == nil {
tmplObj = map[string]interface{}{}
}
if err := runtime.Set("template", tmplObj); err != nil {
return err
}

Expand Down

0 comments on commit 7ce1b3e

Please sign in to comment.