From 210b6ef83220862a91f87413f710f35cd04db2d5 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 9 Sep 2019 09:10:03 -0700 Subject: [PATCH] Fix another manual bounds check Similar to 036856b4ece141c30af471bc50a470a47012d76f (#38). --- view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view.go b/view.go index 52cb346a..d0e357e5 100644 --- a/view.go +++ b/view.go @@ -708,7 +708,7 @@ func (v *View) SetLine(y int, text string) error { // SetHighlight toggles highlighting of separate lines, for custom lists // or multiple selection in views. func (v *View) SetHighlight(y int, on bool) error { - if y > len(v.lines) { + if y < 0 || y >= len(v.lines) { err := ErrInvalidPoint return err }