Upstream: vmihailenco#304
When decoding a struct where an interface{} field was encoded as nil, but the decode target has that field pre-populated with a typed pointer (e.g., Data: &Recipe{}), the decoder panics with reflect.Value.Set using unaddressable value.
This is the canonical issue for a family of related panics:
Root cause is in ptrValueDecoder / decodeInterfaceValue — nil-handling path does not check v.CanSet().
Proposed fix (from upstream): Check for nil code in decodeInterfaceValue and use reflect.Zero to safely clear the value.
Upstream: vmihailenco#304
When decoding a struct where an
interface{}field was encoded as nil, but the decode target has that field pre-populated with a typed pointer (e.g.,Data: &Recipe{}), the decoder panics withreflect.Value.Set using unaddressable value.This is the canonical issue for a family of related panics:
Root cause is in
ptrValueDecoder/decodeInterfaceValue— nil-handling path does not checkv.CanSet().Proposed fix (from upstream): Check for nil code in
decodeInterfaceValueand usereflect.Zeroto safely clear the value.