pipe: don't crash if part is nil

This commit is contained in:
Reto Brunner 2020-07-05 14:27:21 +02:00
parent 1790b1e7f0
commit 60c36ca1f1
1 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,9 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
}) })
} else if pipePart { } else if pipePart {
p := provider.SelectedMessagePart() p := provider.SelectedMessagePart()
if p == nil {
return fmt.Errorf("could not fetch message part")
}
store := provider.Store() store := provider.Store()
store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) { store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) {
if background { if background {