From 8bb115dbae928111be52ed422dafb1caf72a744c Mon Sep 17 00:00:00 2001 From: Kevin Kuehler Date: Sun, 14 Jul 2019 00:42:24 -0700 Subject: commands: Don't crash when store is nil On a slow network connection, running these commands without this guard will cause aerc to panic. Signed-off-by: Kevin Kuehler --- commands/account/search.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'commands/account') diff --git a/commands/account/search.go b/commands/account/search.go index a8640dc..0687c5b 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -51,6 +51,9 @@ func (_ SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("No account selected") } store := acct.Store() + if store == nil { + return errors.New("Cannot perform action. Messages still loading") + } aerc.SetStatus("Searching...") store.Search(criteria, func(uids []uint32) { aerc.SetStatus("Search complete.") -- cgit v1.2.3