Skip to content

Commit

Permalink
Merge pull request #50 from negz/contextual
Browse files Browse the repository at this point in the history
Handle nil context fields, not just a nil context
  • Loading branch information
negz authored Oct 16, 2023
2 parents 26c3c27 + ffe3c15 commit 0a4b30c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion response/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func To(req *v1beta1.RunFunctionRequest, ttl time.Duration) *v1beta1.RunFunction

// SetContextKey sets context to the supplied key.
func SetContextKey(rsp *v1beta1.RunFunctionResponse, key string, v *structpb.Value) {
if rsp.Context == nil {
if rsp.GetContext().GetFields() == nil {
rsp.Context = &structpb.Struct{Fields: make(map[string]*structpb.Value)}
}
rsp.Context.Fields[key] = v
Expand Down

0 comments on commit 0a4b30c

Please sign in to comment.