From cbd35e0d17a26d8be6f05483d9befec48c28982e Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Fri, 14 Jun 2024 10:04:14 -0400
Subject: [PATCH] Bug fix from ansa

---
 indra/llui/llscrolllistctrl.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 8acd2ff5bfc..dce95ea0562 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -933,6 +933,7 @@ BOOL LLScrollListCtrl::selectFirstItem()
 // virtual
 BOOL LLScrollListCtrl::selectNthItem( S32 target_index )
 {
+    target_index = llclamp(target_index, 0, (S32)mItemList.size() - 1);
     return selectItemRange(target_index, target_index);
 }
 
-- 
GitLab