aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-03-18 19:44:18 +0100
committerSimon Ser <contact@emersion.fr>2020-03-18 19:44:18 +0100
commita455fc8ddd74555fc418a9d58a096ad54977b7e1 (patch)
treeac873cea7043cc69e0c012bd8ebdc41d57427b1d /plugins
parentdd5633ac51440dba70066567eede920511212f27 (diff)
downloadalps-a455fc8ddd74555fc418a9d58a096ad54977b7e1.tar.gz
alps-a455fc8ddd74555fc418a9d58a096ad54977b7e1.zip
plugins/base: fix IMAMessage.PartByPath with nil path
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/base/imap.go3
1 files changed, 3 insertions, 0 deletions
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 {