diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-19 02:41:08 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-19 02:41:08 +0300 |
commit | b67e29c0bbda8653002aa1830dd16e8318487f5e (patch) | |
tree | d3f6b24df2a0f65a38972b39a91811954b41ea84 /telegram/formatter | |
parent | 72b336a5f5641adcfa535270862191d9072dba3c (diff) |
Fix a crash on spoilersv1.1.3
Diffstat (limited to 'telegram/formatter')
-rw-r--r-- | telegram/formatter/formatter.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/telegram/formatter/formatter.go b/telegram/formatter/formatter.go index 2946a55..999d659 100644 --- a/telegram/formatter/formatter.go +++ b/telegram/formatter/formatter.go @@ -98,6 +98,10 @@ func EntityToMarkdown(entity *client.TextEntity) (*Insertion, *Insertion) { // EntityToXEP0393 generates the wrapping XEP-0393 tags func EntityToXEP0393(entity *client.TextEntity) (*Insertion, *Insertion) { + if entity == nil || entity.Type == nil { + return nil, nil + } + switch entity.Type.TextEntityTypeType() { case client.TypeTextEntityTypeBold: return markupBraces(entity, boldRunesXEP0393, boldRunesXEP0393) |