Skip to content

Commit df570ab

Browse files
authored
Merge pull request #22 from Zhenay/main
fix: Handle empty spans
2 parents 0ae2e39 + e50c0a1 commit df570ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

etfpy/utils.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ def _handle_spans(spans) -> Optional[Tuple[Any]]:
7676
"""
7777
try:
7878
record = tuple(span.text.strip() for span in spans)
79-
return record[:2] if len(record) > 2 else record
79+
length = len(record)
80+
if length > 2:
81+
return record[:2]
82+
elif length == 2:
83+
return record
84+
return None
8085
except Exception as e:
8186
logger.debug("couldn't parse profile container %s", str(e))
8287
return None

0 commit comments

Comments
 (0)