Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move: avoid crash when message list is not ready
Fix the following crash: panic: runtime error: invalid memory address or nil pointer dereference goroutine 1 [running]: runtime/panic.go:770 +0x132 git.sr.ht/~rjarry/aerc/lib.(*MessageStore).Selected(...) git.sr.ht/~rjarry/aerc/lib/msgstore.go:709 git.sr.ht/~rjarry/aerc/commands/msg.Move.CallBack() git.sr.ht/~rjarry/aerc/commands/msg/move.go:178 +0x78 git.sr.ht/~rjarry/aerc/commands/msg.Move.Execute.func1() git.sr.ht/~rjarry/aerc/commands/msg/move.go:75 +0x90 git.sr.ht/~rjarry/aerc/lib.(*MessageStore).Move.func1() git.sr.ht/~rjarry/aerc/lib/msgstore.go:645 +0x138 When a move operation finishes, the callback is invoked but there is no guarantee that the target account has any message store ready (e.g. IMAP may be disconnected). Only access acct.Store() in the happy code path and even there, only use store if is is not nil. Fixes: 40c25ca ("mv: allow to move messages across accounts") Link: https://lists.sr.ht/~rjarry/aerc-devel/%[email protected]%3E Link: https://lists.sr.ht/~rjarry/aerc-devel/%[email protected]%3E Link: https://lists.sr.ht/~rjarry/aerc-devel/%[email protected]%3E Reported-by: Alex Freudenberg <[email protected]> Reported-by: Evin Yulo <[email protected]> Reported-by: Maarten Aertsen <[email protected]> Reported-by: Yuri Schaeffer <[email protected]> Signed-off-by: Robin Jarry <[email protected]> Acked-by: Tim Culverhouse <[email protected]> Acked-by: Tristan Partin <[email protected]>
- Loading branch information