diff --git a/src/caselawclient/models/identifiers/__init__.py b/src/caselawclient/models/identifiers/__init__.py index a87a3669..da40e341 100644 --- a/src/caselawclient/models/identifiers/__init__.py +++ b/src/caselawclient/models/identifiers/__init__.py @@ -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]