From b307375c82d81cc69b2bf39513e087dc435414ad Mon Sep 17 00:00:00 2001 From: jx11r Date: Sat, 24 Sep 2022 13:36:21 -0500 Subject: [PATCH] Fix empty messages on IRC --- bridge/helper/helper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go index fb65d8d93..0208dff1b 100644 --- a/bridge/helper/helper.go +++ b/bridge/helper/helper.go @@ -86,6 +86,12 @@ func GetSubLines(message string, maxLineLength int, clippingMessage string) []st var lines []string for _, line := range strings.Split(strings.TrimSpace(message), "\n") { + if line == "" { + // Prevent sending empty messages, so we'll skip this line + // if it has no content. + continue + } + if maxLineLength == 0 || len([]byte(line)) <= maxLineLength { lines = append(lines, line) continue