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

SearchResponse.Documents throws null reference exception on successful call #8340

Open
stromblom opened this issue Sep 9, 2024 · 0 comments
Labels
8.x Relates to 8.x client version Area: Client Category: Bug

Comments

@stromblom
Copy link

stromblom commented Sep 9, 2024

Elastic.Clients.Elasticsearch version:
8.15.5

Description of the problem including expected versus actual behavior:
SearchResponse.Documents throws a null ref exception because HitsMetadata is null (and/or possibly HitsMetadata.Hits).

Stacktrace:
at Elastic.Clients.Elasticsearch.SearchResponse`1.get_Documents() in /_/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchResponse.cs:line 21

Expected behavior
Should not throw an exception. HitsMetadata/Hits being null should be handled gracefully.
The Documents property and also Hits property should handle HitsMetadata being null and also declare correct nullability.

@stromblom stromblom added 8.x Relates to 8.x client version Category: Bug labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to 8.x client version Area: Client Category: Bug
Projects
None yet
Development

No branches or pull requests

2 participants