diff options
author | Simon Ser <contact@emersion.fr> | 2020-03-18 19:44:18 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-03-18 19:44:18 +0100 |
commit | a455fc8ddd74555fc418a9d58a096ad54977b7e1 (patch) | |
tree | ac873cea7043cc69e0c012bd8ebdc41d57427b1d /plugins | |
parent | dd5633ac51440dba70066567eede920511212f27 (diff) | |
download | alps-a455fc8ddd74555fc418a9d58a096ad54977b7e1.tar.gz alps-a455fc8ddd74555fc418a9d58a096ad54977b7e1.zip |
plugins/base: fix IMAMessage.PartByPath with nil path
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/base/imap.go | 3 |
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 { |