Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

null pointer exception - decoding "null" type #432

@vgough

Description

@vgough

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions