From 6e11a020d4498f77c858af6b2635bc227537830e Mon Sep 17 00:00:00 2001 From: Tom Lebreux Date: Tue, 16 Apr 2019 19:48:05 -0400 Subject: Fix segfault on :select-message for unloaded messages Signed-off-by: Tom Lebreux --- commands/account/select-message.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'commands/account') diff --git a/commands/account/select-message.go b/commands/account/select-message.go index 54f48f2..c9e4f8a 100644 --- a/commands/account/select-message.go +++ b/commands/account/select-message.go @@ -29,6 +29,9 @@ func SelectMessage(aerc *widgets.Aerc, args []string) error { if acct == nil { return errors.New("No account selected") } + if acct.Messages().Empty() { + return nil + } acct.Messages().Select(n) return nil } -- cgit 1.4.1-2-gfad0