Avoid None entities

Disk6969 2023-07-26 21:23:43 +03:00
parent fbd5450a20
commit 12ad97b8a9

@ -91,7 +91,7 @@ class CustomMarkdown:
return text, entities
@staticmethod
def unparse(text, entities):
for i, e in enumerate(entities):
for i, e in enumerate(entities or []):
if isinstance(e, types.MessageEntityCustomEmoji):
entities[i] = types.MessageEntityTextUrl(e.offset, e.length, f'emoji/{e.document_id}')
if isinstance(e, types.MessageEntitySpoiler):