Skip to content

Commit

Permalink
Fix get title regex
Browse files Browse the repository at this point in the history
  • Loading branch information
nikdoof committed Nov 21, 2021
1 parent 343f4ec commit f77e21a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tildejsongen.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_title(filename: str) -> str:
with open(filename, 'r') as fobj:
raw_html = fobj.read()
res = re.search('<title>(.*?)</title>', raw_html)
if len(res.groups()) > 1:
if res and len(res.groups()) >= 1:
return res.group(1)
return '~somebody'

Expand Down

0 comments on commit f77e21a

Please sign in to comment.