Skip to content

Commit fae1e92

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 d126ab7 commit fae1e92

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
@@ -1009,8 +1009,15 @@ function TradeQueryClass:PriceItemRowDisplay(row_idx, top_pane_alignment_ref, ro
10091009
end
10101010
end
10111011
controls["resultDropdown"..row_idx].tooltipFunc = function(tooltip, dropdown_mode, dropdown_index, dropdown_display_string)
1012-
local pb_index = self.sortedResultTbl[row_idx][dropdown_index].index
1013-
local result = self.resultTbl[row_idx][pb_index]
1012+
local sortedRow = self.sortedResultTbl[row_idx]
1013+
if not sortedRow or not sortedRow[dropdown_index] then
1014+
return
1015+
end
1016+
local pb_index = sortedRow[dropdown_index].index
1017+
local result = self.resultTbl[row_idx] and self.resultTbl[row_idx][pb_index]
1018+
if not result then
1019+
return
1020+
end
10141021
local item = new("Item", result.item_string)
10151022
tooltip:Clear()
10161023
self.itemsTab:AddItemTooltip(tooltip, item, slotTbl)

0 commit comments

Comments
 (0)