From 7585a54832cc045962a769b65861bf174202b891 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Wed, 19 Oct 2022 15:22:32 -0500 Subject: [PATCH] split: prevent panic when store is not set Prevent panic when split is called but the msgstore is either not initialized or has no UIDs. This condition could be triggered by calling :split or :vsplit immediately at startup. Use the same logic as the :view command, which could operate in a similar manner. Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- commands/account/split.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/account/split.go b/commands/account/split.go index 284182d..64ca4f9 100644 --- a/commands/account/split.go +++ b/commands/account/split.go @@ -30,6 +30,9 @@ func (Split) Execute(aerc *widgets.Aerc, args []string) error { if acct == nil { return errors.New("No account selected") } + if acct.Messages().Empty() { + return nil + } n := 0 var err error if len(args) > 1 {