From 60c36ca1f196074cbf0c5bc957737307e75b6cf0 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sun, 5 Jul 2020 14:27:21 +0200 Subject: pipe: don't crash if part is nil --- commands/msg/pipe.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'commands') diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index c88d61f..20cb8b4 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -126,6 +126,9 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { }) } else if pipePart { p := provider.SelectedMessagePart() + if p == nil { + return fmt.Errorf("could not fetch message part") + } store := provider.Store() store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) { if background { -- cgit 1.4.1-2-gfad0