Skip to content

Bad requests cause a NullReferenceException in ElasticClient #658

@gmarz

Description

@gmarz

After some recent changes (possibly #633), bad requests (ElasticsearchResponse.Success == false) are throwing a NullReferenceException in ElasticClient.ResultsSelector<D, Q, R> if no RequestConfiguration is setup on the descriptor, because ElasticsearchResponse.Response is null and allowStatusCode evaluates to true.

If it's correct that the Response property should be null for invalid requests, then I think allowStatusCode should default to false when there is no request configuration.

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