cloudevents/sdk-go

cloudEvent client error: “invalid CloudEvents value:(*string)(nil)”

kycheng opened this issue · 1 comments

I used SetExtension to set a null pointer to string and got this error.

sdk-go/v2/types/value.go

Lines 146 to 150 in 39fe13d

if rx.Kind() == reflect.Ptr && !rx.IsNil() {
// Allow pointers-to convertible types
return Validate(rx.Elem().Interface())
}
return nil, fmt.Errorf("invalid CloudEvents value: %#v", v)

Code verification null pointer error.

Can we set data to zero value when we encounter null pointer?

duglin commented

Can you show me your code that calls this?