Quantcast

Hide the ilvl line when UnitExists returns false.

Scott Sibley [01-05-11 - 04:24]
Hide the ilvl line when UnitExists returns false.
Filename
Modules/UnitTooltip/UnitTooltip.lua
diff --git a/Modules/UnitTooltip/UnitTooltip.lua b/Modules/UnitTooltip/UnitTooltip.lua
index c57e372..0d9a35c 100644
--- a/Modules/UnitTooltip/UnitTooltip.lua
+++ b/Modules/UnitTooltip/UnitTooltip.lua
@@ -448,13 +448,12 @@ return select(2, GetRole(unit))
 	[22] = {
 		name = "Avg Item Level",
 		left = [[
+if not UnitExists(unit) then return "" end
 return "Item Level:"
 ]],
 		right = [[
-if not UnitExists(unit) then return oldILevel end
-local str = UnitILevel(unit)
-oldILevel = str
-return str
+if not UnitExists(unit) then return "" end
+return UnitILevel(unit)
 ]],
 		rightUpdating = true,
 		enabled = true,