Skip to content

Commit

Permalink
fix: handle empty stack gracefully (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-urbanski-freiheit-com authored Feb 28, 2024
1 parent e2499ef commit bca7caa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/cd-service/pkg/repository/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ func RunTransformer(ctx context.Context, t Transformer, s *State) (string, *Tran
if err := runner.Execute(t); err != nil {
return "", nil, err
}
return runner.Stack[0][0], &TransformerResult{
commitMsg := ""
if len(runner.Stack[0]) > 0 {
commitMsg = runner.Stack[0][0]
}
return commitMsg, &TransformerResult{
ChangedApps: runner.ChangedApps,
DeletedRootApps: runner.DeletedRootApps,
Commits: runner.Commits,
Expand Down

0 comments on commit bca7caa

Please sign in to comment.