Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radaron committed Jun 7, 2024
1 parent 665c86d commit d0f9b59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elasticmock/fake_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def search(self, index=None, doc_type=None, body=None, params=None, headers=None
else:
hits = sorted(hits, key=lambda k: k['_source'][key])

if 'from' in body and 'size' in body and body['from'] + body['size'] > 0:
if body is not None and 'from' in body and 'size' in body and body['from'] + body['size'] > 0:
hits = hits[body['from']:body['from'] + body['size']]

if 'scroll' in params:
Expand Down

0 comments on commit d0f9b59

Please sign in to comment.