Skip to content

Commit 1844ac4

Browse files
mcagnionclaude
andcommitted
fix(trade): guard nil sortedResultTbl in dropdown tooltipFunc
The nil guard lost during the vaisest/trader-improvements merge caused a crash when hovering the result dropdown after clearing search results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent be599ce commit 1844ac4

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/Classes/TradeQuery.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,15 @@ function TradeQueryClass:PriceItemRowDisplay(row_idx, top_pane_alignment_ref, ro
10431043
end
10441044
end
10451045
controls["resultDropdown"..row_idx].tooltipFunc = function(tooltip, dropdown_mode, dropdown_index, dropdown_display_string)
1046-
local pb_index = self.sortedResultTbl[row_idx][dropdown_index].index
1047-
local result = self.resultTbl[row_idx][pb_index]
1046+
local sortedRow = self.sortedResultTbl[row_idx]
1047+
if not sortedRow or not sortedRow[dropdown_index] then
1048+
return
1049+
end
1050+
local pb_index = sortedRow[dropdown_index].index
1051+
local result = self.resultTbl[row_idx] and self.resultTbl[row_idx][pb_index]
1052+
if not result then
1053+
return
1054+
end
10481055
local item = new("Item", result.item_string)
10491056
tooltip:Clear()
10501057
if slotTbl.slotName == "Watcher's Eye" then

0 commit comments

Comments
 (0)