Fix: out of range index pick
This commit is contained in:
2
tui.go
2
tui.go
@@ -382,7 +382,7 @@ func init() {
|
|||||||
return event
|
return event
|
||||||
}
|
}
|
||||||
selectedIndex = siInt
|
selectedIndex = siInt
|
||||||
if len(chatBody.Messages)+1 < selectedIndex || selectedIndex < 0 {
|
if len(chatBody.Messages)-1 < selectedIndex || selectedIndex < 0 {
|
||||||
msg := "chosen index is out of bounds"
|
msg := "chosen index is out of bounds"
|
||||||
logger.Warn(msg, "index", selectedIndex)
|
logger.Warn(msg, "index", selectedIndex)
|
||||||
if err := notifyUser("error", msg); err != nil {
|
if err := notifyUser("error", msg); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user