Skip to content

Commit

Permalink
Fix html_caption for None. Return None instead if exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorKhabarov committed Jul 28, 2024
1 parent bd48956 commit cd98710
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,8 @@ def html_caption(self):
"""
Returns html-rendered caption.
"""
if self.caption is None:
return None
return apply_html_entities(self.caption, self.caption_entities, getattr(self, "custom_subs", None))

@property
Expand Down

0 comments on commit cd98710

Please sign in to comment.