From 9611b463f5eae013ce11e72f9b3427bb30e154d6 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 28 Jan 2023 03:19:14 +0200 Subject: [PATCH] Ignore embeds with no supported parts --- portal.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/portal.go b/portal.go index e907956..473961a 100644 --- a/portal.go +++ b/portal.go @@ -763,6 +763,10 @@ func (portal *Portal) handleDiscordEmbed(intent *appservice.IntentAPI, embed *di htmlParts = append(htmlParts, fmt.Sprintf(embedHTMLFooterOnlyDate, embedDateHTML)) } + if len(htmlParts) == 0 { + return nil + } + compiledHTML := strings.Join(htmlParts, "") if embed.Color != 0 { compiledHTML = fmt.Sprintf(embedHTMLWrapperColor, embed.Color, compiledHTML)