Skip to content

Commit 011039e

Browse files
committed
Handle case where star element is present but there is no count.
fix #33
1 parent 836df16 commit 011039e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sopy/se_data/models/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ def html_load(cls, element, room_id, ts_date=None, update=True):
110110
o.rendered = True
111111

112112
stars_elem = element.find('span', class_='stars')
113-
o.stars = int(stars_elem.find('span', class_='times').string) if stars_elem is not None else 0
113+
o.stars = int(stars_elem.find('span', class_='times').string or 0) if stars_elem is not None else 0
114114

115115
return o

0 commit comments

Comments
 (0)