From ee33fef96f6bb698f008c02dbd70db65c5760dcd Mon Sep 17 00:00:00 2001 From: Rubin Raithel <33808743+Coronon@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:12:43 +0200 Subject: [PATCH] fix: index out of range error --- monitors/email_ping.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/monitors/email_ping.go b/monitors/email_ping.go index 6cf32a6..fc02a3e 100644 --- a/monitors/email_ping.go +++ b/monitors/email_ping.go @@ -293,6 +293,11 @@ func (m *emailPingMonitor) receive_email(data *emailData, shouldWaitForResponse return message, 0, errors.New(message) } } + if len(uids) == 0 { + zap.S().Debugln("IMAP no response found - not waiting") + + return "", 0, nil + } zap.S().Debugln("IMAP response found") // Fetch the reply email