Skip to content

Commit

Permalink
fix: Invalid memory address or nil pointer dereference (#9409)
Browse files Browse the repository at this point in the history
Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>

Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
  • Loading branch information
sarabala1979 authored Aug 22, 2022
1 parent 7d9319b commit 6f19e50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1944,13 +1944,14 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string,
}
}

node = woc.wf.GetNodeByName(node.Name)
if node == nil {
retrieveNode := woc.wf.GetNodeByName(node.Name)
if retrieveNode == nil {
err := fmt.Errorf("no Node found by the name of %s; wf.Status.Nodes=%+v", node.Name, woc.wf.Status.Nodes)
woc.log.Error(err)
woc.markWorkflowError(ctx, err)
return node, err
}
node = retrieveNode

// Swap the node back to retry node
if retryNodeName != "" {
Expand Down

0 comments on commit 6f19e50

Please sign in to comment.