Fix: Guard nil checks for iconData.Name and tip.title in MapIconTooltip
This commit is contained in:
@@ -193,15 +193,23 @@ function MapIconTooltip:Show()
|
|||||||
if not npcAndObjectOrder["default"] then
|
if not npcAndObjectOrder["default"] then
|
||||||
npcAndObjectOrder["default"] = {npcNames = {}, quests = {}};
|
npcAndObjectOrder["default"] = {npcNames = {}, quests = {}};
|
||||||
end
|
end
|
||||||
npcAndObjectOrder["default"].npcNames[iconData.Name] = true
|
if iconData.Name then
|
||||||
npcAndObjectOrder["default"].quests[tip.title] = tip
|
npcAndObjectOrder["default"].npcNames[iconData.Name] = true
|
||||||
|
end
|
||||||
|
if tip and tip.title then
|
||||||
|
npcAndObjectOrder["default"].quests[tip.title] = tip
|
||||||
|
end
|
||||||
elseif iconData.Type == "monster" or iconData.Type == "killcredit" or iconData.Type == "spell" or iconData.Type == "object" or iconData.Type == "event" or iconData.Type == "item" then
|
elseif iconData.Type == "monster" or iconData.Type == "killcredit" or iconData.Type == "spell" or iconData.Type == "object" or iconData.Type == "event" or iconData.Type == "item" then
|
||||||
local tip = _MapIconTooltip:GetAvailableOrCompleteTooltip(icon)
|
local tip = _MapIconTooltip:GetAvailableOrCompleteTooltip(icon)
|
||||||
if not npcAndObjectOrder["default"] then
|
if not npcAndObjectOrder["default"] then
|
||||||
npcAndObjectOrder["default"] = {npcNames = {}, quests = {}};
|
npcAndObjectOrder["default"] = {npcNames = {}, quests = {}};
|
||||||
end
|
end
|
||||||
npcAndObjectOrder["default"].npcNames[iconData.Name] = true
|
if iconData.Name then
|
||||||
npcAndObjectOrder["default"].quests[tip.title] = tip
|
npcAndObjectOrder["default"].npcNames[iconData.Name] = true
|
||||||
|
end
|
||||||
|
if tip and tip.title then
|
||||||
|
npcAndObjectOrder["default"].quests[tip.title] = tip
|
||||||
|
end
|
||||||
elseif iconData.CustomTooltipData then
|
elseif iconData.CustomTooltipData then
|
||||||
manualOrder[iconData.CustomTooltipData.Title] = { Body = { iconData.CustomTooltipData.Body or "" } }
|
manualOrder[iconData.CustomTooltipData.Title] = { Body = { iconData.CustomTooltipData.Body or "" } }
|
||||||
elseif iconData.ManualTooltipData then
|
elseif iconData.ManualTooltipData then
|
||||||
|
|||||||
Reference in New Issue
Block a user