~rjarry/aerc

7f28ba10d5e900e2ba41ff411f8e60580e663016 — Koni Marti a month ago edeac1a
forward: fix panic when using :eml

Fix a panic when forwarding a message that was opened with :eml.
:forward will try to the set the forwarded flag but there's no
associated message store available for that message (it's either loaded
from disk or an attachment).

Fixes: b94b4c00c9c9 ("forward: allow forwarded flag to be set")
Reported-by: inwit <inwit@sindominio.net>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
1 files changed, 2 insertions(+), 2 deletions(-)

M commands/msg/forward.go
M commands/msg/forward.go => commands/msg/forward.go +2 -2
@@ 167,7 167,7 @@ func (f forward) Execute(args []string) error {
			}
			composer.AddAttachment(tmpFileName)
			composer.OnClose(func(c *app.Composer) {
				if c.Sent() {
				if c.Sent() && store != nil {
					store.Forwarded([]models.UID{msg.Uid}, true, nil)
				}
				os.RemoveAll(tmpDir)


@@ 219,7 219,7 @@ func (f forward) Execute(args []string) error {
			}

			composer.OnClose(func(c *app.Composer) {
				if c.Sent() {
				if c.Sent() && store != nil {
					store.Forwarded([]models.UID{msg.Uid}, true, nil)
				}
			})