Skip to content

NullReferenceException in AggregationsHelper #1048

@mausch

Description

@mausch

Just got a NullReferenceException in https://github.com/elasticsearch/elasticsearch-net/blob/develop/src/Nest/Domain/Aggregations/AggregationsHelper.cs#L127 .
This is because TryGet can return null but then this is never checked anywhere in this class.
IMHO the code should detect the null and throw a specific exception, e.g "Term aggregation XXX not found", what do you think?
Or return null just as many other methods in this class do, like ReverseNested, Nested, etc.

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