From 596bbcfe81e2202198415767a06afd9cd1c49d6d Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 28 Jan 2025 18:28:09 +0200 Subject: Fixed crash where frequency view will be called after changing the network due to out of bounds indexing --- internal/client/ui/core/frequencylist/frequencylist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/client/ui') diff --git a/internal/client/ui/core/frequencylist/frequencylist.go b/internal/client/ui/core/frequencylist/frequencylist.go index 7c58817..1c7fe22 100644 --- a/internal/client/ui/core/frequencylist/frequencylist.go +++ b/internal/client/ui/core/frequencylist/frequencylist.go @@ -302,7 +302,7 @@ func (m *Model) Index() int { func (m *Model) SetIndex(index int) { m.index = min(max(index, 0), m.FrequenciesLength()-1) if m.index < m.base { - m.base = m.index + m.base = max(m.index, 0) } else if m.index >= m.base+m.height { m.base = 1 + m.index - m.height } -- cgit v1.3.1