send: fix crash if invalid password is given

This commit is contained in:
Reto Brunner 2021-02-05 21:20:17 +01:00
parent 8ea86cea41
commit 2d2010fd42

View file

@ -113,6 +113,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
} }
if err != nil { if err != nil {
failCh <- errors.Wrap(err, "send:") failCh <- errors.Wrap(err, "send:")
return
} }
var writer io.Writer = sender var writer io.Writer = sender
@ -132,7 +133,7 @@ func (Send) Execute(aerc *widgets.Aerc, args []string) error {
go func() { go func() {
err = <-failCh err = <-failCh
if err != nil { if err != nil {
aerc.PushError(err.Error()) aerc.PushError(strings.ReplaceAll(err.Error(), "\n", " "))
aerc.NewTab(composer, tabName) aerc.NewTab(composer, tabName)
return return
} }