Skip to content

Commit

Permalink
handle TypeError in validator of PydanticObjectId (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
grthr committed Feb 26, 2024
1 parent 72b35f9 commit cad8960
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beanie/odm/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def validate(cls, v, _: ValidationInfo):
v = v.decode("utf-8")
try:
return PydanticObjectId(v)
except InvalidId:
except (InvalidId, TypeError):
raise ValueError("Id must be of type PydanticObjectId")

@classmethod
Expand Down

0 comments on commit cad8960

Please sign in to comment.