about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--commands/account/next.go4
-rw-r--r--widgets/account.go3
2 files changed, 5 insertions, 2 deletions
diff --git a/commands/account/next.go b/commands/account/next.go
index 7b1f230..1ba4b1b 100644
--- a/commands/account/next.go
+++ b/commands/account/next.go
@@ -65,14 +65,14 @@ func ExecuteNextPrevMessage(args []string, acct *widgets.AccountView, pct bool,
 		store := acct.Store()
 		if store != nil {
 			store.NextPrev(-n)
+			acct.Messages().Scroll()
 		}
-		acct.Messages().Scroll()
 	} else {
 		store := acct.Store()
 		if store != nil {
 			store.NextPrev(n)
+			acct.Messages().Scroll()
 		}
-		acct.Messages().Scroll()
 	}
 	return nil
 }
diff --git a/widgets/account.go b/widgets/account.go
index 07b5010..688b660 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -164,6 +164,9 @@ func (acct *AccountView) Messages() *MessageList {
 }
 
 func (acct *AccountView) Store() *lib.MessageStore {
+	if acct.msglist == nil {
+		return nil
+	}
 	return acct.msglist.Store()
 }