aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2023-07-19 00:30:34 +0200
committerRobin Jarry <robin@jarry.cc>2023-07-28 21:22:15 +0200
commit02eeed0b489870e3b6f0668c62e2f98ac6bb1d31 (patch)
tree1288a957e275c63cc376fee96b8a770eed64fe37
parent5062493d49c00983caba1a2c4cf3aacbb7d6ae71 (diff)
downloadaerc-02eeed0b489870e3b6f0668c62e2f98ac6bb1d31.tar.gz
aerc-02eeed0b489870e3b6f0668c62e2f98ac6bb1d31.zip
split: ensure messagestore is available
Checking that a messagestore is connected, prevents crashes when aerc has disconnected or :v?split is called without delay inside the aerc-startup hook. Reported-by: Ryan Roden-Corrent <ryan@rcorre.net> Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--commands/account/split.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/account/split.go b/commands/account/split.go
index 6641641b..7a5acc47 100644
--- a/commands/account/split.go
+++ b/commands/account/split.go
@@ -30,6 +30,10 @@ func (Split) Execute(aerc *widgets.Aerc, args []string) error {
if acct == nil {
return errors.New("No account selected")
}
+ store := aerc.SelectedAccount().Store()
+ if store == nil {
+ return errors.New("Cannot perform action. Messages still loading")
+ }
n := 0
if acct.SplitSize() == 0 {
if args[0] == "split" {