From b912f6ffa39dcf29ddbd1f73e7e7f1c0ec574b04 Mon Sep 17 00:00:00 2001 From: Atony <75191600+AtonyGit@users.noreply.github.com> Date: Sat, 3 Oct 2026 19:09:28 -0500 Subject: [PATCH] Add search box reset safeguard --- MiraAPI/Patches/RoleGuidePatches.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/MiraAPI/Patches/RoleGuidePatches.cs b/MiraAPI/Patches/RoleGuidePatches.cs index 523bce2..7eaff7e 100644 --- a/MiraAPI/Patches/RoleGuidePatches.cs +++ b/MiraAPI/Patches/RoleGuidePatches.cs @@ -389,8 +389,19 @@ public static class RoleGuidePatches { _searchIconIdle.sprite = MiraAssets.SearchIconIdleSprite; _searchIconHover.sprite = MiraAssets.SearchIconHoverSprite; - searchBoxTmp.SetText(string.Empty); - var newSorted = sortMethod is SortingMethod.Alphabetical ? RolePanels.OrderBy(GetSortingOrder()) : RolePanels.OrderByDescending(GetSortingOrder()); + try + { + searchBoxTmp.outputText.SetText(string.Empty); + searchBoxTmp.SetText(string.Empty); + } + catch + { + // ignored + } + + var newSorted = sortMethod is SortingMethod.Alphabetical + ? RolePanels.OrderBy(GetSortingOrder()) + : RolePanels.OrderByDescending(GetSortingOrder()); foreach (var pair in newSorted) {