Skip to content

Commit

Permalink
fix(Identifiers): preferred identifier now correctly handles case whe…
Browse files Browse the repository at this point in the history
…re there are none of type
  • Loading branch information
jacksonj04 committed Dec 20, 2024
1 parent 1a58fc3 commit 750cac5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/caselawclient/models/identifiers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@ def preferred(self, type: Optional[type[Identifier]] = None) -> Optional[Identif
:return: Return the highest scoring identifier of the given type (or of any type, if none is specified). Returns `None` if no identifier is available.
"""
if len(self) == 0:
if len(self.by_score(type)) == 0:
return None
return self.by_score(type)[0]

0 comments on commit 750cac5

Please sign in to comment.