Skip to content

Commit

Permalink
do not try to convert null values in comparer
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-martino committed Dec 3, 2024
1 parent 16e5b00 commit ec710b6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions musify/processors/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def compare[T: Any](self, item: T, reference: T | None = None) -> bool:
if self.reference_required: # use the values from the reference as the expected values
expected = to_collection(reference[tag_name], list)
else: # convert the expected values to the same type as the actual value if not yet converted
if not self._converted:
if not self._converted and self.expected is not None:
self._convert_expected(actual)
expected = self.expected

Expand All @@ -118,9 +118,6 @@ def compare[T: Any](self, item: T, reference: T | None = None) -> bool:

def _convert_expected(self, value: Any) -> None:
"""Driver for converting expected values to the same type as given value"""
if self._converted or value is None:
return

if isinstance(value, int):
self._convert_expected_to_int()
self._converted = True
Expand Down

0 comments on commit ec710b6

Please sign in to comment.