Skip to content

Commit

Permalink
Fix internal server error when querying without field (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
msm-cert authored Jul 11, 2024
1 parent 73d394c commit 5f3c778
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mwdb/core/search/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ def get_field_mapper(
else:
selected_type = queried_type

if not field_path:
# Malformed query like `blob:"*"`
fields = ", ".join(field_mapping[selected_type.__name__].keys())
error = f"Can't query {field_name} directly. Try one of fields: {fields}."
raise FieldNotQueryableException(error)

# Map object field selector
field_name, asterisks = field_path[0]
if field_name in field_mapping[selected_type.__name__]:
Expand Down

0 comments on commit 5f3c778

Please sign in to comment.