plugins/base: fix IMAMessage.PartByPath with nil path
This commit is contained in:
parent
dd5633ac51
commit
a455fc8ddd
1 changed files with 3 additions and 0 deletions
|
@ -196,6 +196,9 @@ func (msg *IMAPMessage) PartByPath(path []int) *IMAPPartNode {
|
||||||
if msg.BodyStructure == nil {
|
if msg.BodyStructure == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if len(path) == 0 {
|
||||||
|
return newIMAPPartNode(msg, nil, msg.BodyStructure)
|
||||||
|
}
|
||||||
|
|
||||||
var result *IMAPPartNode
|
var result *IMAPPartNode
|
||||||
msg.BodyStructure.Walk(func(p []int, part *imap.BodyStructure) bool {
|
msg.BodyStructure.Walk(func(p []int, part *imap.BodyStructure) bool {
|
||||||
|
|
Loading…
Reference in a new issue