From 3ad5deaff12abdba195824a940ab053ad6630752 Mon Sep 17 00:00:00 2001 From: Jair Sanchez <78786202+jx11r@users.noreply.github.com> Date: Sat, 26 Nov 2022 16:53:48 -0600 Subject: Fix empty messages on IRC (#1897) --- bridge/helper/helper.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bridge') diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go index fb65d8d9..0208dff1 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 -- cgit v1.2.3