Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null pointer exception - decoding "null" type #432

Open
vgough opened this issue Aug 12, 2024 · 1 comment
Open

null pointer exception - decoding "null" type #432

vgough opened this issue Aug 12, 2024 · 1 comment

Comments

@vgough
Copy link

vgough commented Aug 12, 2024

Using ocf.NewDecoder(r) on a random avro file, the Decode operation panics due to a null pointer exception from hamba/avro. The issue is that newEfaceDecoder inside codec_dynamic does not check the error of genericReceiver and proceeds with a nil typ value, which causes a null pointer exception later in the code.

One fix could be to add a Null condition in genericReceiver in codec_generic.go:

	case Null:
		return reflect2.TypeOf((*null)(nil)), nil

That at least results in a "avro: schema type null in unsupported" error rather than a NPE. Ideally errors should also not be ignored, and turned into some sort of error upward.

@nrwiersma
Copy link
Member

Can you provide a small bit a of code that reproduces the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants