From ce6832dd76b9646540b278a9cce1d1fa76f40568 Mon Sep 17 00:00:00 2001 From: nbsp Date: Tue, 7 Jan 2025 15:41:45 +0200 Subject: [PATCH] fix panic --- app/subscriptions.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/subscriptions.go b/app/subscriptions.go index 38b597b..90006e2 100644 --- a/app/subscriptions.go +++ b/app/subscriptions.go @@ -67,8 +67,10 @@ func (subscriptions *Subscriptions) Event(state *ui.State, event vaxis.Event) (p subscriptions.list.SetItem(subscriptions.list.Index(), formatNeighbor(user, subscriptions.subscriptions)) } case "Enter", "l", "Right": - subscriptions.subscriptions.Write() - ui.ViewChange <- NewUserPage(subscriptions.neighbors[subscriptions.list.Index()].Name) + if len(subscriptions.list.Items()) > 0 { + subscriptions.subscriptions.Write() + ui.ViewChange <- NewUserPage(subscriptions.neighbors[subscriptions.list.Index()].Name) + } } processed = true }