Skip to content

Commit

Permalink
Added check for body is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
snakeye committed Oct 7, 2018
1 parent 2c08bbe commit 3cd13b2
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 @@ -185,7 +185,7 @@ def search(self, index=None, doc_type=None, body=None, params=None):
result['hits']['hits'] = hits

# build aggregations
if 'aggs' in body:
if body is not None and 'aggs' in body:
aggregations = {}

for aggregation, definition in body['aggs'].items():
Expand Down

0 comments on commit 3cd13b2

Please sign in to comment.