From 9e28a02f6a4345ec7b5fdee68864610186f34e91 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 17 Mar 2019 14:57:05 -0400 Subject: commands: handle case where no account selected --- commands/cf.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'commands/cf.go') diff --git a/commands/cf.go b/commands/cf.go index 83b757c..d8b0508 100644 --- a/commands/cf.go +++ b/commands/cf.go @@ -20,6 +20,9 @@ func ChangeFolder(aerc *widgets.Aerc, args []string) error { return errors.New("Usage: cf ") } acct := aerc.SelectedAccount() + if acct == nil { + return errors.New("No account selected") + } previous := acct.Directories().Selected() if args[1] == "-" { if dir, ok := history[acct.Name()]; ok { -- cgit v1.2.3