about summary refs log tree commit diff stats
path: root/commands/msg
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-07-05 14:27:21 +0200
committerReto Brunner <reto@labrat.space>2020-07-05 14:27:21 +0200
commit60c36ca1f196074cbf0c5bc957737307e75b6cf0 (patch)
tree85f84deffd42c246252e7fc054dbc8464eeaabfc /commands/msg
parent1790b1e7f012d8be36d71e45d652609e107d055b (diff)
downloadaerc-60c36ca1f196074cbf0c5bc957737307e75b6cf0.tar.gz
pipe: don't crash if part is nil
Diffstat (limited to 'commands/msg')
-rw-r--r--commands/msg/pipe.go3
1 files changed, 3 insertions, 0 deletions
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 {