From 0a5c89eb5d490ea7bd68910d9c6c60d6a8082ed9 Mon Sep 17 00:00:00 2001 From: itzaname Date: Sat, 7 Jan 2017 04:58:52 -0500 Subject: [PATCH] Don't waste requests --- message.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/message.go b/message.go index 5b0b9ad..3ec2715 100644 --- a/message.go +++ b/message.go @@ -100,6 +100,10 @@ func (s *Session) SendMessage(subject string, body string, recipientid int) erro // ArchiveMessages will archive a list of messages func (s *Session) ArchiveMessages(ids []string) error { + if len(ids) <= 0 { + return fmt.Errorf("ID list was empty") + } + payload := map[string][]string{ "messageIds": ids, }