You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, When I use this example code from readme, I got the right schema, but when decode the content, the function schema.Codec().NativeFromBinary(content) paniced with this error: panic: runtime error: invalid memory address or nil pointer dereference. Could someone tell me, how could I fix it?
Total Logs are:
2021-12-24T14:08:24.694+0800 INFO Get a message {"Value": "AAAAAUQAAiAxMTM4ODE2NzcwMTM5NDUxAhQxMjM0NTc0NTMxFiowMzE2MDA5MTM4AhAxNjAwOTE1MwICMNSfAigyMDIwLTA1LTI4VDIwOjE2OjQ4WgAYYXdiOHh2cDJza3NnBjE0MgIzDDAwMDAwMQJBAgAMMDAwMDAwAgIAAgQnEAIEJqwCBCcQAjACAAACMgIIMDAwMAIM5oiQ5YqfAgACAAIAAgACAgACAgACAmQoOTg1MTI4MzUzNzA2NTA4OTcwMTIIMDAwOAICMAIwAjEEMDMCAAIx1J8CAgACAAIAAgACAAIEJxACAgACAjACAAIAAhg2OTIxNTY0NTg2OTQAAgAAAjACBGFhAgACAAACAAA2eyJleHRTeXN0ZW1JZCI6ICJBSVBfQVVUTyJ9AAIwAtSfAgIAFjEuNS4wLkZpbmFsCm15c3FsGnFtX3Rlc3RfbXlzcWyoiuGmvV8ACHRydWUceWluZzk5X2Z1bmR0eG4AAhRmdW5kX29yZGVyAAAgbXlzcWwtYmluLjAwMDAwMYbgpO8DAAAAAnICxorhpr1fAA==", "Header": null}
2021-12-24T14:08:24.850+0800 INFO Schema info {"Schema": "{\"type\":\"record\",\"name\": ****** }
2021-12-24T14:08:24.850+0800 INFO Content {"RawData": "AAIgMTEzODgxNjc3MDEzOTQ1MQIUMTIzNDU3NDUzMRYqMDMxNjAwOTEzOAIQMTYwMDkxNTMCAjDUnwIoMjAyMC0wNS0yOFQyMDoxNjo0OFoAGGF3Yjh4dnAyc2tzZwYxNDICMwwwMDAwMDECQQIADDAwMDAwMAICAAIEJxACBCasAgQnEAIwAgAAAjICCDAwMDACDOaIkOWKnwIAAgACAAIAAgIAAgIAAgJkKDk4NTEyODM1MzcwNjUwODk3MDEyCDAwMDgCAjACMAIxBDAzAgACMdSfAgIAAgACAAIAAgACBCcQAgIAAgIwAgACAAIYNjkyMTU2NDU4Njk0AAIAAAIwAgRhYQIAAgAAAgAANnsiZXh0U3lzdGVtSWQiOiAiQUlQX0FVVE8ifQACMALUnwICABYxLjUuMC5GaW5hbApteXNxbBpxbV90ZXN0X215c3FsqIrhpr1fAAh0cnVlHHlpbmc5OV9mdW5kdHhuAAIUZnVuZF9vcmRlcgAAIG15c3FsLWJpbi4wMDAwMDGG4KTvAwAAAAJyAsaK4aa9XwA="}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x66f3c3]
goroutine 1 [running]:
github.com/linkedin/goavro/v2.(*Codec).NativeFromBinary(0xc0000a2280, {0xc00009a005, 0x1a0, 0x1a0})
/Users/***/go/pkg/mod/github.com/linkedin/goavro/v2@v2.10.1/codec.go:344 +0x23
The text was updated successfully, but these errors were encountered:
// Codec ensures access to Codec
// Will try to initialize a new one if it hasn't been initialized before
// Will return nil if it can't initialize a codec from the schema
func (schema *Schema) Codec() *goavro.Codec {
if schema.codec == nil {
codec, err := goavro.NewCodec(schema.Schema())
if err == nil {
schema.codec = codec
}
}
return schema.codec
}
The function Codec() return nill, and not return the err info...
Hi, When I use this example code from readme, I got the right schema, but when decode the content, the function
schema.Codec().NativeFromBinary(content)
paniced with this error:panic: runtime error: invalid memory address or nil pointer dereference
. Could someone tell me, how could I fix it?Total Logs are:
The text was updated successfully, but these errors were encountered: