Commit ad73da3
fix: add nil check when accessing workflow nodes in retry logic
When retrying a workflow with parameter override, the code accesses
wf.Status.Nodes[nodeID] without checking if the nodeID exists. Since
Nodes is a map[string]NodeStatus, accessing a non-existent key returns
a zero value without panicking, but it's safer to explicitly check
existence using the comma-ok idiom.
This prevents potential issues where toReset might contain nodeIDs that
don't exist in wf.Status.Nodes in edge cases.
Also renamed the second 'ok' variable to 'okNode' to avoid shadowing
the first 'ok' variable.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Yu-Hong Shen <stanley.shen2003@gmail.com>1 parent d191ce7 commit ad73da3
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1240 | 1240 | | |
1241 | 1241 | | |
1242 | 1242 | | |
1243 | | - | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
1244 | 1247 | | |
1245 | | - | |
| 1248 | + | |
1246 | 1249 | | |
1247 | 1250 | | |
1248 | 1251 | | |
| |||
0 commit comments