Skip to content

Commit 23ccb3a

Browse files
committed
check bounds from paginator
Fixes #153
1 parent bc1a053 commit 23ccb3a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/model/uimodel.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ func (u *UIModel) View() string {
103103
u.paginator.Page = u.paginator.TotalPages - 1
104104
}
105105
start, end := u.paginator.GetSliceBounds(stats.NumNodes)
106-
for _, n := range stats.Nodes[start:end] {
107-
u.writeNodeInfo(n, ctw, u.cluster.resources)
106+
if start >= 0 && end >= start {
107+
for _, n := range stats.Nodes[start:end] {
108+
u.writeNodeInfo(n, ctw, u.cluster.resources)
109+
}
108110
}
109111
ctw.Flush()
110112

0 commit comments

Comments
 (0)