From a455fc8ddd74555fc418a9d58a096ad54977b7e1 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 18 Mar 2020 19:44:18 +0100 Subject: plugins/base: fix IMAMessage.PartByPath with nil path --- plugins/base/imap.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/base') diff --git a/plugins/base/imap.go b/plugins/base/imap.go index 177fefc..dd78e3f 100755 --- a/plugins/base/imap.go +++ b/plugins/base/imap.go @@ -196,6 +196,9 @@ func (msg *IMAPMessage) PartByPath(path []int) *IMAPPartNode { if msg.BodyStructure == nil { return nil } + if len(path) == 0 { + return newIMAPPartNode(msg, nil, msg.BodyStructure) + } var result *IMAPPartNode msg.BodyStructure.Walk(func(p []int, part *imap.BodyStructure) bool { -- cgit v1.2.3