summary refs log tree commit diff stats
path: root/commands/cf.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/cf.go')
-rw-r--r--commands/cf.go3
1 files changed, 3 insertions, 0 deletions
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 <folder>")
 	}
 	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 {