aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/aerc.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 3621201f..fffbf021 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -334,7 +334,10 @@ func (aerc *Aerc) SelectedAccountUiConfig() *config.UIConfig {
}
func (aerc *Aerc) SelectedTab() ui.Drawable {
- return aerc.tabs.Tabs[aerc.tabs.Selected].Content
+ if aerc.NumTabs() == 0 || aerc.SelectedTabIndex() >= aerc.NumTabs() {
+ return nil
+ }
+ return aerc.tabs.Tabs[aerc.SelectedTabIndex()].Content
}
func (aerc *Aerc) SelectedTabIndex() int {