plugins/base: fix IMAMessage.PartByPath with nil path

This commit is contained in:
Simon Ser 2020-03-18 19:44:18 +01:00
parent dd5633ac51
commit a455fc8ddd
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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 {