Skip to content

Commit

Permalink
forward: fix panic when using :eml
Browse files Browse the repository at this point in the history
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: b94b4c0 ("forward: allow forwarded flag to be set")
Reported-by: inwit <[email protected]>
Signed-off-by: Koni Marti <[email protected]>
Tested-by: Inwit <[email protected]>
Acked-by: Robin Jarry <[email protected]>
  • Loading branch information
konimarti authored and rjarry committed Nov 9, 2024
1 parent edeac1a commit 7f28ba1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commands/msg/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
})
Expand Down

0 comments on commit 7f28ba1

Please sign in to comment.