Skip to content

Commit

Permalink
Merge pull request #2357 from EgorKhabarov/develop
Browse files Browse the repository at this point in the history
Fix html_caption for None. Return None instead if exception.
  • Loading branch information
Badiboy authored Jul 28, 2024
2 parents bd48956 + cd98710 commit 8ba533a
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 8ba533a

Please sign in to comment.