Skip to content

Commit

Permalink
Fix another manual bounds check (#40)
Browse files Browse the repository at this point in the history
Fix another manual bounds check
  • Loading branch information
mjarkk authored Sep 9, 2019
2 parents 446ca33 + 210b6ef commit f8bfb59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f8bfb59

Please sign in to comment.