Skip to content

Commit

Permalink
add a guard in case the property is nil (#1366)
Browse files Browse the repository at this point in the history
Co-authored-by: Darwin D Wu <darwin67@users.noreply.github.com>
  • Loading branch information
darwin67 and darwin67 committed May 16, 2024
1 parent 64734a6 commit 9ae81d6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/execution/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ func (r *ResumeRequest) SetData(data any) {
}

func (r *ResumeRequest) withKey(key string) string {
if withData, ok := r.With.(map[string]any)[key]; ok {
byt, err := json.Marshal(withData)
if err == nil {
return string(byt)
if r.With != nil {
if withData, ok := r.With.(map[string]any)[key]; ok {
byt, err := json.Marshal(withData)
if err == nil {
return string(byt)
}
return ""
}
return ""
}

return ""
Expand Down

0 comments on commit 9ae81d6

Please sign in to comment.