Skip to content

Commit

Permalink
Merge pull request #22 from Zhenay/main
Browse files Browse the repository at this point in the history
fix: Handle empty spans
  • Loading branch information
JakubPluta authored Jul 2, 2024
2 parents 0ae2e39 + e50c0a1 commit df570ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion etfpy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ def _handle_spans(spans) -> Optional[Tuple[Any]]:
"""
try:
record = tuple(span.text.strip() for span in spans)
return record[:2] if len(record) > 2 else record
length = len(record)
if length > 2:
return record[:2]
elif length == 2:
return record
return None
except Exception as e:
logger.debug("couldn't parse profile container %s", str(e))
return None
Expand Down

0 comments on commit df570ab

Please sign in to comment.